Java ByteBuffer Read readByteBuffer(ByteBuffer buf)

Here you can find the source of readByteBuffer(ByteBuffer buf)

Description

read Byte Buffer

License

Open Source License

Declaration

public static byte[] readByteBuffer(ByteBuffer buf) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    public static byte[] readByteBuffer(ByteBuffer buf) {
        int pos = buf.position();
        byte[] r = new byte[buf.limit() - buf.position()];
        buf.get(r);/*from  w ww.  j ava  2 s  . c  om*/
        buf.position(pos);
        return r;
    }
}

Related

  1. readBoolean(ByteBuffer buff)
  2. readBooleanArray(ByteBuffer in)
  3. readBuf(ByteBuffer buffer)
  4. readBuffer(ByteChannel channel, ByteBuffer buffer)
  5. readBufferFully(FileChannel fc, ByteBuffer buf, int startPos)
  6. readByteBufferFromFile(String filepath)
  7. readChars(ByteBuffer bb, int length)
  8. readCharsUTF8(ByteBuffer bb, int length)
  9. readCInt(ByteBuffer buffer)