国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

App下載
首頁(yè)javaarrayJava Collection - 如何從偏移處開(kāi)始的數(shù)組獲取子數(shù)組

Java Collection - 如何從偏移處開(kāi)始的數(shù)組獲取子數(shù)組

我們想知道如何從偏移處開(kāi)始的數(shù)組獲取子數(shù)組。
  
/*
 * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2006.
 *
 * Licensed under the Aduna BSD-style license.
 */

public class Utils {
  /**
   * Gets the subarray from <tt>array</tt> that starts at <tt>offset</tt>.
   */
  public static byte[] get(byte[] array, int offset) {
    return get(array, offset, array.length - offset);
  }

  /**
   * Gets the subarray of length <tt>length</tt> from <tt>array</tt>
   * that starts at <tt>offset</tt>.
   */
  public static byte[] get(byte[] array, int offset, int length) {
    byte[] result = new byte[length];
    System.arraycopy(array, offset, result, 0, length);
    return result;
  }
}