Java ByteBuffer Read readBuf(ByteBuffer buffer)

Here you can find the source of readBuf(ByteBuffer buffer)

Description

read Buf

License

BSD License

Declaration

public static ByteBuffer readBuf(ByteBuffer buffer) 

Method Source Code

//package com.java2s;
/**/*from ww  w  .j a v  a  2 s . c o m*/
 * This class is part of JCodec ( www.jcodec.org ) This software is distributed
 * under FreeBSD License
 * 
 * @author The JCodec project
 * 
 */

import java.nio.ByteBuffer;

public class Main {
    public static ByteBuffer readBuf(ByteBuffer buffer) {
        ByteBuffer result = buffer.duplicate();
        buffer.position(buffer.limit());
        return result;
    }

    public static ByteBuffer duplicate(ByteBuffer bb) {
        ByteBuffer out = ByteBuffer.allocate(bb.remaining());
        out.put(bb.duplicate());
        out.flip();
        return out;
    }
}

Related

  1. readASCII(ByteBuffer buffer)
  2. readAsciiString(MappedByteBuffer buffer, int pos, int length)
  3. readBE(ByteBuffer bb, int elementWidth)
  4. readBoolean(ByteBuffer buff)
  5. readBooleanArray(ByteBuffer in)
  6. readBuffer(ByteChannel channel, ByteBuffer buffer)
  7. readBufferFully(FileChannel fc, ByteBuffer buf, int startPos)
  8. readByteBuffer(ByteBuffer buf)
  9. readByteBufferFromFile(String filepath)