Here you can find the source of copyArrayRange(final byte[] value, int start, int end)
Parameter | Description |
---|---|
value | The byte[] to be parsed |
start | The index of the first item to be copied |
end | The index after the last item to be copied |
static public byte[] copyArrayRange(final byte[] value, int start, int end)
//package com.java2s; /**//from ww w. j a va 2 s. com * **************************************************************************** * Copyright (c) 2015, MasterCard International Incorporated and/or its * affiliates. All rights reserved. * <p/> * The contents of this file may only be used subject to the MasterCard * Mobile Payment SDK for MCBP and/or MasterCard Mobile MPP UI SDK * Materials License. * <p/> * Please refer to the file LICENSE.TXT for full details. * <p/> * TO THE EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON INFRINGEMENT. TO THE EXTENT PERMITTED BY LAW, IN NO EVENT SHALL * MASTERCARD OR ITS AFFILIATES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * ***************************************************************************** */ public class Main { /** * Copy a sub range of the given array start is included, end is excluded * @param value The byte[] to be parsed * @param start The index of the first item to be copied * @param end The index after the last item to be copied * @return The copied range */ static public byte[] copyArrayRange(final byte[] value, int start, int end) { int noBytes = end - start; byte[] result = new byte[noBytes]; System.arraycopy(value, start, result, 0, noBytes); return result; } }