|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.io.AbstractBuffer
public abstract class AbstractBuffer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Buffer |
|---|
Buffer.CaseInsensitve |
| Field Summary | |
|---|---|
protected static String |
__IMMUTABLE
|
protected static String |
__READONLY
|
protected static String |
__READWRITE
|
protected static String |
__VOLATILE
|
protected int |
_access
|
protected int |
_get
|
protected int |
_hash
|
protected int |
_hashGet
|
protected int |
_hashPut
|
protected int |
_mark
|
protected int |
_put
|
protected String |
_string
|
protected View |
_view
|
protected boolean |
_volatile
|
| Fields inherited from interface org.eclipse.jetty.io.Buffer |
|---|
IMMUTABLE, NON_VOLATILE, READONLY, READWRITE, VOLATILE |
| Constructor Summary | |
|---|---|
AbstractBuffer(int access,
boolean isVolatile)
Constructor for BufferView |
|
| Method Summary | |
|---|---|
byte[] |
asArray()
|
Buffer |
asImmutableBuffer()
|
Buffer |
asMutableBuffer()
|
Buffer |
asNonVolatileBuffer()
|
Buffer |
asReadOnlyBuffer()
|
Buffer |
buffer()
Get the unerlying buffer. |
void |
clear()
Clear the buffer. |
void |
compact()
Compact the buffer by discarding bytes before the postion (or mark if set). |
ByteArrayBuffer |
duplicate(int access)
|
boolean |
equals(Object obj)
|
boolean |
equalsIgnoreCase(Buffer b)
|
byte |
get()
Get the byte at the current getIndex and increment it. |
int |
get(byte[] b,
int offset,
int length)
Get bytes from the current postion and put them into the passed byte array. |
Buffer |
get(int length)
|
int |
getIndex()
The index within the buffer that will next be read or written. |
boolean |
hasContent()
|
int |
hashCode()
|
boolean |
isImmutable()
|
boolean |
isReadOnly()
|
boolean |
isVolatile()
|
int |
length()
The number of bytes from the getIndex to the putIndex |
void |
mark()
Set the mark to the current getIndex. |
void |
mark(int offset)
Set the mark relative to the current getIndex |
int |
markIndex()
The current index of the mark. |
byte |
peek()
Get the byte at the current getIndex without incrementing the getIndex. |
Buffer |
peek(int index,
int length)
|
int |
poke(int index,
Buffer src)
Put the contents of the buffer at the specific index. |
int |
poke(int index,
byte[] b,
int offset,
int length)
Put a specific byte to a specific getIndex. |
int |
put(Buffer src)
Write the bytes from the source buffer to the current getIndex. |
void |
put(byte b)
Put a byte to the current getIndex and increment the getIndex. |
int |
put(byte[] b)
Put a byte to the current getIndex and increment the getIndex. |
int |
put(byte[] b,
int offset,
int length)
Put a byte to the current getIndex and increment the getIndex. |
int |
putIndex()
The index of the first element that should not be read. |
int |
readFrom(InputStream in,
int max)
Read the buffer's contents from the input stream |
void |
reset()
Reset the current getIndex to the mark |
void |
rewind()
|
void |
setGetIndex(int getIndex)
Set the buffers start getIndex. |
void |
setMarkIndex(int index)
Set a specific value for the mark. |
void |
setPutIndex(int putIndex)
|
int |
skip(int n)
Skip _content. |
Buffer |
slice()
|
Buffer |
sliceFromMark()
|
Buffer |
sliceFromMark(int length)
|
int |
space()
the space remaining in the buffer. |
String |
toDebugString()
|
String |
toDetailString()
|
String |
toString()
|
String |
toString(String charset)
|
void |
writeTo(OutputStream out)
Write the buffer's contents to the output stream |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.jetty.io.Buffer |
|---|
array, capacity, peek, peek, poke |
| Field Detail |
|---|
protected static final String __IMMUTABLE
protected static final String __READONLY
protected static final String __READWRITE
protected static final String __VOLATILE
protected int _access
protected boolean _volatile
protected int _get
protected int _put
protected int _hash
protected int _hashGet
protected int _hashPut
protected int _mark
protected String _string
protected View _view
| Constructor Detail |
|---|
public AbstractBuffer(int access,
boolean isVolatile)
access - 0==IMMUTABLE, 1==READONLY, 2==READWRITE| Method Detail |
|---|
public byte[] asArray()
asArray in interface Bufferbyte[] value of the bytes from the getIndex to the putIndex.public ByteArrayBuffer duplicate(int access)
public Buffer asNonVolatileBuffer()
asNonVolatileBuffer in interface BufferBuffer valuepublic Buffer asImmutableBuffer()
asImmutableBuffer in interface BufferBuffer.public Buffer asReadOnlyBuffer()
asReadOnlyBuffer in interface BufferBuffer.public Buffer asMutableBuffer()
asMutableBuffer in interface BufferBuffer.public Buffer buffer()
Buffer
buffer in interface Bufferpublic void clear()
Buffer
clear in interface Bufferpublic void compact()
Buffer
compact in interface Bufferpublic boolean equals(Object obj)
equals in class Objectpublic boolean equalsIgnoreCase(Buffer b)
equalsIgnoreCase in interface Bufferboolean value true if case sensitive comparison on this bufferpublic byte get()
Buffer
get in interface Bufferbyte value from the current getIndex.
public int get(byte[] b,
int offset,
int length)
Buffer
get in interface Bufferb - The byte array to fill.offset - Offset in the array.length - The max number of bytes to read.
public Buffer get(int length)
get in interface Bufferlength - an int value
Buffer valuepublic final int getIndex()
Buffer
getIndex in interface Bufferint value >=0 <= putIndex()public boolean hasContent()
hasContent in interface Bufferpublic int hashCode()
hashCode in class Objectpublic boolean isImmutable()
isImmutable in interface Bufferboolean value true if the buffer is immutable and that neither
the buffer contents nor the indexes may be changed.public boolean isReadOnly()
isReadOnly in interface Bufferboolean value true if the buffer is readonly. The buffer indexes may
be modified, but the buffer contents may not. For example a View onto an immutable Buffer will be
read only.public boolean isVolatile()
isVolatile in interface Bufferboolean value true if the buffer contents may change
via alternate paths than this buffer. If the contents of this buffer are to be used outside of the
current context, then a copy must be made.public int length()
Buffer
length in interface Bufferint == putIndex()-getIndex()public void mark()
Buffer
mark in interface Bufferpublic void mark(int offset)
Buffer
mark in interface Bufferoffset - an int value to add to the current getIndex to obtain the mark value.public int markIndex()
Buffer
markIndex in interface Bufferint index in the buffer or -1 if the mark is not set.public byte peek()
Buffer
peek in interface Bufferbyte value from the current getIndex.
public Buffer peek(int index,
int length)
peek in interface Bufferindex - an int valuelength - an int value
Buffer value from the requested getIndex.
public int poke(int index,
Buffer src)
Buffer
poke in interface Bufferindex - 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 Bufferindex - an int valueb - a byte array value
public int put(Buffer src)
Buffer
put in interface Buffersrc - The source Buffer it is not modified.
public void put(byte b)
Buffer
put in interface Bufferb - a byte value
public int put(byte[] b,
int offset,
int length)
Buffer
put in interface Bufferb - a byte value
public int put(byte[] b)
Buffer
put in interface Bufferb - a byte value
public final int putIndex()
Buffer
putIndex in interface Bufferint value >= getIndex()public void reset()
Buffer
reset in interface Bufferpublic void rewind()
public void setGetIndex(int getIndex)
Buffer
setGetIndex in interface BuffergetIndex - an int valuepublic void setMarkIndex(int index)
Buffer
setMarkIndex in interface Bufferindex - an int valuepublic void setPutIndex(int putIndex)
setPutIndex in interface BufferputIndex - an int valuepublic int skip(int n)
Buffer
skip in interface Buffern - The number of bytes to skip
public Buffer slice()
slice in interface BufferBuffer from the postion to the putIndex.public Buffer sliceFromMark()
sliceFromMark in interface BufferBuffer value from the mark to the putIndexpublic Buffer sliceFromMark(int length)
sliceFromMark in interface Bufferlength - an int value
Buffer value from the mark of the length requested.public int space()
Buffer
space in interface Bufferpublic String toDetailString()
toDetailString in interface BufferString value describing the state and contents of the buffer.public String toString()
toString in class Objectpublic String toString(String charset)
toString in interface Bufferpublic String toDebugString()
public void writeTo(OutputStream out)
throws IOException
Buffer
writeTo in interface BufferIOException
public int readFrom(InputStream in,
int max)
throws IOException
Buffer
readFrom in interface Bufferin - input streammax - maximum number of bytes that may be read
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||