public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer
Buffer.CaseInsensitve| Modifier and Type | Field and Description |
|---|---|
protected java.nio.ByteBuffer |
_buf |
__IMMUTABLE, __READONLY, __READWRITE, __VOLATILE, _access, _get, _hash, _hashGet, _hashPut, _mark, _put, _string, _view, _volatile| Constructor and Description |
|---|
DirectNIOBuffer(java.nio.ByteBuffer buffer,
boolean immutable) |
DirectNIOBuffer(java.io.File file) |
DirectNIOBuffer(int size) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array()
Get the underlying array, if one exists.
|
int |
capacity()
The capacity of the buffer.
|
java.nio.ByteBuffer |
getByteBuffer() |
boolean |
isDirect() |
byte |
peek(int position)
Get the byte at a specific index in the buffer.
|
int |
peek(int index,
byte[] b,
int offset,
int length) |
int |
poke(int index,
Buffer src)
Put the contents of the buffer at the specific index.
|
void |
poke(int index,
byte b)
Put a specific byte to a specific getIndex.
|
int |
poke(int index,
byte[] b,
int offset,
int length)
Put a specific byte to a specific getIndex.
|
int |
readFrom(java.io.InputStream in,
int max)
Read the buffer's contents from the input stream
|
void |
writeTo(java.io.OutputStream out)
Write the buffer's contents to the output stream
|
asArray, asImmutableBuffer, asMutableBuffer, asNonVolatileBuffer, asReadOnlyBuffer, buffer, clear, compact, duplicate, equals, equalsIgnoreCase, get, get, get, getIndex, hasContent, hashCode, isImmutable, isReadOnly, isVolatile, length, mark, mark, markIndex, peek, peek, put, put, put, put, putIndex, reset, rewind, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, space, toDebugString, toDetailString, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitasArray, asImmutableBuffer, asMutableBuffer, asNonVolatileBuffer, asReadOnlyBuffer, buffer, clear, compact, equalsIgnoreCase, get, get, get, getIndex, hasContent, isImmutable, isReadOnly, isVolatile, length, mark, mark, markIndex, peek, peek, put, put, put, put, putIndex, reset, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, space, toDetailString, toStringpublic DirectNIOBuffer(int size)
public DirectNIOBuffer(java.nio.ByteBuffer buffer,
boolean immutable)
public DirectNIOBuffer(java.io.File file)
throws java.io.IOException
file - java.io.IOExceptionpublic byte[] array()
Bufferpublic int capacity()
Bufferpublic byte peek(int position)
Bufferpublic int peek(int index,
byte[] b,
int offset,
int length)
public void poke(int index,
byte b)
Bufferpublic int poke(int index,
Buffer src)
Bufferpoke in interface Bufferpoke in class AbstractBufferindex - an int valuesrc - a Buffer. If the source buffer is not modifiedpublic int poke(int index,
byte[] b,
int offset,
int length)
Bufferpoke in interface Bufferpoke in class AbstractBufferindex - an int valueb - a byte array valuepublic java.nio.ByteBuffer getByteBuffer()
getByteBuffer in interface NIOBufferpublic int readFrom(java.io.InputStream in,
int max)
throws java.io.IOException
BufferreadFrom in interface BufferreadFrom in class AbstractBufferin - input streammax - maximum number of bytes that may be readjava.io.IOExceptionpublic void writeTo(java.io.OutputStream out)
throws java.io.IOException
BufferwriteTo in interface BufferwriteTo in class AbstractBufferjava.io.IOExceptionCopyright © 2013 FuseSource, Corp.. All Rights Reserved.