Here you can find the source of readIntArray(ByteBuffer buf)
Parameter | Description |
---|---|
buf | a parameter |
arr | a parameter |
public static int[] readIntArray(ByteBuffer buf)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Vladimir Rodionov. All Rights Reserved * * This code is released under the GNU Affero General Public License. * * See: http://www.fsf.org/licensing/licenses/agpl-3.0.html * * VLADIMIR RODIONOV MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR * NON-INFRINGEMENT. Vladimir Rodionov SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED * BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR * ITS DERIVATIVES.//from ww w .j a v a2s .c o m * * Author: Vladimir Rodionov * *******************************************************************************/ import java.nio.ByteBuffer; public class Main { /** * No array length * @param buf * @param arr */ public static int[] readIntArray(ByteBuffer buf) { final int size = buf.getInt(); int[] arr = new int[size]; for (int i = 0; i < size; i++) { arr[i] = buf.getInt(); } return arr; } }