Java Array Slice SliceByteArray(byte data[], int offset, int length)

Here you can find the source of SliceByteArray(byte data[], int offset, int length)

Description

Slice Byte Array

License

Open Source License

Parameter

Parameter Description
data a parameter
offset a parameter
length a parameter

Declaration

public static byte[] SliceByteArray(byte data[], int offset, int length) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2008, 2014 IBM Corp./*from w  w  w  .  j  a va  2s .co  m*/
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v1.0 which accompany this distribution. 
 *
 * The Eclipse Public License is available at 
 *    http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at 
 *   http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *    Ian Craggs - initial API and implementation and/or initial documentation
 *******************************************************************************/

public class Main {
    /**
     * @param data
     * @param offset
     * @param length
     * @return
     */
    public static byte[] SliceByteArray(byte data[], int offset, int length) {
        byte temp[] = new byte[length];
        System.arraycopy(data, offset, temp, 0, length);
        return (temp);
    }
}

Related

  1. slice(T[] array, int index)
  2. slice(T[] array, int index, int length)
  3. slice(T[] array, int start, int finish)
  4. slice(T[] items, int offset, int length)
  5. sliceArray(final String[] array, final int start)
  6. sliceBytes(byte[] bytes, int offset, int length)
  7. sliceFromFinalBoundary(Object[] sequence, Boolean[] boundaries)
  8. slicesFromAllBoundaries(Object[] sequence, Boolean[] boundaries)
  9. sliceStringArray(String[] a, Integer l)