Java ByteBuffer Read readToBytes(ByteBuffer byteBuffer)

Here you can find the source of readToBytes(ByteBuffer byteBuffer)

Description

read To Bytes

License

Apache License

Declaration

public static byte[] readToBytes(ByteBuffer byteBuffer) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static byte[] readToBytes(ByteBuffer byteBuffer) {

        int remain = byteBuffer.remaining();
        byte[] data = new byte[remain];
        byteBuffer.get(data);/*from   w ww .  ja  v  a 2  s . c o m*/
        return data;
    }
}

Related

  1. readShortString(ByteBuffer buffer)
  2. readSignedVarint(ByteBuffer buffer)
  3. readSize(ByteBuffer buf)
  4. readSize(ByteBuffer buffer)
  5. readSmart(ByteBuffer buffer)
  6. readTs(ByteBuffer is)
  7. readTs(ByteBuffer is, int c)
  8. readUUID(ByteBuffer buffer)
  9. readVariableLength(ByteBuffer buf)