Java ByteBuffer Write writeIntArray(ByteBuffer buf, int[] arr)

Here you can find the source of writeIntArray(ByteBuffer buf, int[] arr)

Description

write Int Array

License

Open Source License

Declaration

public static void writeIntArray(ByteBuffer buf, int[] arr) 

Method Source Code

//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  w  ww .jav  a  2s .c  o  m
*
* Author: Vladimir Rodionov
*
*******************************************************************************/

import java.nio.ByteBuffer;

public class Main {
    public static void writeIntArray(ByteBuffer buf, int[] arr) {
        final int size = arr.length;
        buf.putInt(size);
        for (int i = 0; i < size; i++) {
            buf.putInt(arr[i]);
        }
    }
}

Related

  1. writeInt(ByteBuffer buf, int pos, int v)
  2. writeInt(ByteBuffer logBuf, int i)
  3. writeInt24(int v, ByteBuffer buffer)
  4. writeInt4(final ByteBuffer bb, int value, int highValue, final boolean flush)
  5. writeInt8(final ByteBuffer bb, int value)
  6. writeInts4(final ByteBuffer bb, final int... values)
  7. writeL(ByteBuffer to, ByteBuffer from, int count)
  8. writeLen(int len, ByteBuffer dest, int dOff)
  9. writeLength(ByteBuffer buffer, long l)