Android Array Copy copyOf(byte[] bytes)

Here you can find the source of copyOf(byte[] bytes)

Description

copy Of

License

Apache License

Declaration

public static byte[] copyOf(byte[] bytes) 

Method Source Code

//package com.java2s;
/**//from   w w w  . j  av a2  s . c o m
 * Source obtained from crypto-gwt. Apache 2 License.
 * https://code.google.com/p/crypto-gwt/source/browse/crypto-gwt/src/main/java/com/googlecode/
 * cryptogwt/util/ByteArrayUtils.java
 */

public class Main {
    public static byte[] copyOf(byte[] bytes) {
        return copyOfRange(bytes, 0, bytes.length);
    }

    public static byte[] copyOfRange(byte[] bytes, int offset, int len) {
        byte[] result = new byte[len];
        System.arraycopy(bytes, offset, result, 0, len);
        return result;
    }
}

Related

  1. copy(float[] src, Buffer dst, int numFloats, int offset)
  2. appendWhereArgsToSelectionArgs( String[] selectionArgs, String[] whereArgs)
  3. arraycopy(String src, int srcOffset, byte[] dst, int dstOffset, int length)
  4. arraycopy(byte[] from, byte[] to)
  5. arrayCopy(byte[] src, int srcPos, byte[] dest, int destPos, int length)
  6. copyOfRange(byte[] bytes, int offset, int len)
  7. copyOfRange(byte[] original, int from, int to)
  8. createCopy(boolean[] array, int dataSize, int newLength)
  9. createCopy(byte[] array, int dataSize, int newLength)