Java ByteBuffer to Int Array getIntByteBuffer(int id)

Here you can find the source of getIntByteBuffer(int id)

Description

get Int Byte Buffer

License

Apache License

Declaration

public static final ByteBuffer getIntByteBuffer(int id) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;

public class Main {
    public static final int intSize = 4;

    public static final ByteBuffer getIntByteBuffer(int id) {
        ByteBuffer buffer = ByteBuffer.allocate(intSize);
        buffer.putInt(id);//from  ww  w. j ava 2  s .c o  m
        buffer.flip();
        return buffer;
    }
}

Related

  1. getInt8(ByteBuffer input)
  2. getIntArray(ByteBuffer buffer, int size)
  3. getIntArray(ByteBuffer data, int offset, int length)
  4. getIntBE(ByteBuffer b, int start, int end)
  5. getIntBE(final ByteBuffer b, final int start, final int end)
  6. getIntegerFromBuffer(ByteBuffer buffer, int offset, int size)
  7. getIntFromBack(ByteBuffer bb)
  8. getIntFromByteBuffer(ByteBuffer data)
  9. getIntWithChecksum(ByteBuffer buffer, Adler32 checksum)