Android Array Copy arraycopy(String src, int srcOffset, byte[] dst, int dstOffset, int length)

Here you can find the source of arraycopy(String src, int srcOffset, byte[] dst, int dstOffset, int length)

Description

arraycopy

Declaration

public static void arraycopy(String src, int srcOffset, byte[] dst,
            int dstOffset, int length) 

Method Source Code

//package com.java2s;

public class Main {
    public static void arraycopy(String src, int srcOffset, byte[] dst,
            int dstOffset, int length) {
        if (src == null || dst == null) {
            throw new NullPointerException("invalid byte array ");
        }/*from   w w  w. ja  v  a2s  .  com*/
        if ((src.length() < (srcOffset + length))
                || (dst.length < (dstOffset + length))) {
            throw new IndexOutOfBoundsException("invalid length: " + length);
        }
        for (int i = 0; i < length; i++) {
            dst[dstOffset + i] = (byte) src.charAt(srcOffset + i);
        }
    }
}

Related

  1. copyOf(long[] obj, int newSize)
  2. copyOfRange(final byte[] source, final int from, final int to)
  3. copy(int[] rSource)
  4. copy(float[] src, Buffer dst, int numFloats, int offset)
  5. appendWhereArgsToSelectionArgs( String[] selectionArgs, String[] whereArgs)
  6. arraycopy(byte[] from, byte[] to)
  7. arrayCopy(byte[] src, int srcPos, byte[] dest, int destPos, int length)
  8. copyOf(byte[] bytes)
  9. copyOfRange(byte[] bytes, int offset, int len)