|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.io.AbstractBuffer
org.eclipse.jetty.io.nio.DirectNIOBuffer
public class DirectNIOBuffer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Buffer |
|---|
Buffer.CaseInsensitve |
| Field Summary | |
|---|---|
protected ByteBuffer |
_buf
|
| Fields inherited from class org.eclipse.jetty.io.AbstractBuffer |
|---|
__IMMUTABLE, __READONLY, __READWRITE, __VOLATILE, _access, _get, _hash, _hashGet, _hashPut, _mark, _put, _string, _view, _volatile |
| Fields inherited from interface org.eclipse.jetty.io.Buffer |
|---|
IMMUTABLE, NON_VOLATILE, READONLY, READWRITE, VOLATILE |
| Constructor Summary | |
|---|---|
DirectNIOBuffer(ByteBuffer buffer,
boolean immutable)
|
|
DirectNIOBuffer(File file)
|
|
DirectNIOBuffer(int size)
|
|
| Method Summary | |
|---|---|
byte[] |
array()
Get the underlying array, if one exists. |
int |
capacity()
The capacity of the buffer. |
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(InputStream in,
int max)
Read the buffer's contents from the input stream |
void |
writeTo(OutputStream out)
Write the buffer's contents to the output stream |
| Methods inherited from class org.eclipse.jetty.io.AbstractBuffer |
|---|
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, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.jetty.io.Buffer |
|---|
asArray, 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, toString |
| Field Detail |
|---|
protected final ByteBuffer _buf
| Constructor Detail |
|---|
public DirectNIOBuffer(int size)
public DirectNIOBuffer(ByteBuffer buffer,
boolean immutable)
public DirectNIOBuffer(File file)
throws IOException
file -
IOException| Method Detail |
|---|
public boolean isDirect()
isDirect in interface NIOBufferpublic byte[] array()
Buffer
array in interface Bufferbyte[] backing this buffer or null if none exists.public int capacity()
Buffer
capacity in interface Bufferint valuepublic byte peek(int position)
Buffer
peek in interface Bufferposition - an int value
byte value
public int peek(int index,
byte[] b,
int offset,
int length)
peek in interface Bufferindex - an int valueb - The byte array to peek intooffset - The offset into the array to start peekinglength - an int value
public void poke(int index,
byte b)
Buffer
poke in interface Bufferindex - an int valueb - a byte value
public int poke(int index,
Buffer src)
Buffer
poke in interface Bufferpoke in class AbstractBufferindex - an int valuesrc - a Buffer. If the source buffer is not modified
public int poke(int index,
byte[] b,
int offset,
int length)
Buffer
poke in interface Bufferpoke in class AbstractBufferindex - an int valueb - a byte array value
public ByteBuffer getByteBuffer()
getByteBuffer in interface NIOBuffer
public int readFrom(InputStream in,
int max)
throws IOException
Buffer
readFrom in interface BufferreadFrom in class AbstractBufferin - input streammax - maximum number of bytes that may be read
IOException
public void writeTo(OutputStream out)
throws IOException
Buffer
writeTo in interface BufferwriteTo in class AbstractBufferIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||