Java ByteBuffer Get getUsedBytes(ByteBuffer bb)

Here you can find the source of getUsedBytes(ByteBuffer bb)

Description

get Used Bytes

License

Apache License

Declaration

public static byte[] getUsedBytes(ByteBuffer bb) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static byte[] getUsedBytes(ByteBuffer bb) {
        byte[] data = bb.array();
        byte[] remain = new byte[bb.position()];
        System.arraycopy(data, 0, remain, 0, remain.length);
        return remain;
    }/*from www . j a v a 2s. c o m*/
}

Related

  1. getTruncatedInt(ByteBuffer bytes, int numBytes)
  2. getTsStartSyncByte(ByteBuffer packet, boolean synced)
  3. getTsSyncByte(ByteBuffer packet)
  4. getUByte(ByteBuffer b)
  5. getUleb128(ByteBuffer buffer)
  6. getUTF8FromByteBuffer(ByteBuffer bb)
  7. getUUID(ByteBuffer bytes)
  8. getVariance(ByteBuffer simulationResults)
  9. getVInt(ByteBuffer bf, int index)