Java Byte Array Copy copyBytesToString(byte[] src, int arg1, int arg2)

Here you can find the source of copyBytesToString(byte[] src, int arg1, int arg2)

Description

copy Bytes To String

License

Open Source License

Declaration

public static String copyBytesToString(byte[] src, int arg1, int arg2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String copyBytesToString(byte[] src, int arg1, int arg2) {
        char[] chrs = new char[arg2 - arg1];
        for (int i = 0, j = arg1; j < arg2; i++, j++) {
            chrs[i] = (char) src[j];
        }//from w  ww.jav  a2 s  .co  m

        String s = String.valueOf(chrs);
        return s;
    }
}

Related

  1. copyBytes(final byte[] source, final int sOffset, final byte[] destination, final int dOffset, final int length)
  2. copyBytes(int[] srcArray, int srcPos, byte[] destBytes)
  3. copyBytes(long sourceOffset, byte[] source, int sourceOff, int sourceLength, long destOffset, byte[] dest, int destLength)
  4. copyBytesAtOffset(byte[] dst, byte[] src, int offset)
  5. copyBytesIntoByteArray(byte[] dest, byte[] src)
  6. copyBytesWithin(byte[] bytes, int target, int start, int end)
  7. memcpy(byte[] dest, int doff, byte[] src, int soff, int len)
  8. memcpy(byte[] destBytes, byte[] srcBytes, int numBytes)
  9. memcpy(byte[] dst, int dst_offset, byte[] src, int src_offset, int length)