public class ByteArrayBuffer extends AbstractBuffer
| Modifier and Type | Class and Description |
|---|---|
static class |
ByteArrayBuffer.CaseInsensitive |
Buffer.CaseInsensitve| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_bytes |
__IMMUTABLE, __READONLY, __READWRITE, __VOLATILE, _access, _get, _hash, _hashGet, _hashPut, _mark, _put, _string, _view, _volatile| Modifier | Constructor and Description |
|---|---|
|
ByteArrayBuffer(byte[] bytes) |
|
ByteArrayBuffer(byte[] bytes,
int index,
int length) |
|
ByteArrayBuffer(byte[] bytes,
int index,
int length,
int access) |
|
ByteArrayBuffer(byte[] bytes,
int index,
int length,
int access,
boolean isVolatile) |
|
ByteArrayBuffer(int size) |
protected |
ByteArrayBuffer(int size,
int access,
boolean isVolatile) |
|
ByteArrayBuffer(String value) |
|
ByteArrayBuffer(String value,
boolean immutable) |
|
ByteArrayBuffer(String value,
String encoding) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array()
Get the underlying array, if one exists.
|
int |
capacity()
The capacity of the buffer.
|
void |
compact()
Compact the buffer by discarding bytes before the postion (or mark if set).
|
boolean |
equals(Object obj) |
boolean |
equalsIgnoreCase(Buffer b) |
byte |
get()
Get the byte at the current getIndex and increment it.
|
int |
hashCode() |
byte |
peek(int index)
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
|
int |
space()
the space remaining in the buffer.
|
void |
writeTo(OutputStream out)
Write the buffer's contents to the output stream
|
asArray, asImmutableBuffer, asMutableBuffer, asNonVolatileBuffer, asReadOnlyBuffer, buffer, clear, duplicate, get, get, getIndex, hasContent, isImmutable, isReadOnly, isVolatile, length, mark, mark, markIndex, peek, peek, put, put, put, put, putIndex, reset, rewind, setGetIndex, setMarkIndex, setPutIndex, skip, slice, sliceFromMark, sliceFromMark, toDebugString, toDetailString, toString, toString, toStringprotected ByteArrayBuffer(int size,
int access,
boolean isVolatile)
public ByteArrayBuffer(byte[] bytes)
public ByteArrayBuffer(byte[] bytes,
int index,
int length)
public ByteArrayBuffer(byte[] bytes,
int index,
int length,
int access)
public ByteArrayBuffer(byte[] bytes,
int index,
int length,
int access,
boolean isVolatile)
public ByteArrayBuffer(int size)
public ByteArrayBuffer(String value)
public ByteArrayBuffer(String value, boolean immutable)
public ByteArrayBuffer(String value, String encoding) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic byte[] array()
Bufferbyte[] backing this buffer or null if none exists.public int capacity()
Bufferint valuepublic void compact()
Buffercompact in interface Buffercompact in class AbstractBufferpublic boolean equals(Object obj)
equals in class AbstractBufferpublic boolean equalsIgnoreCase(Buffer b)
equalsIgnoreCase in interface BufferequalsIgnoreCase in class AbstractBufferboolean value true if case sensitive comparison on this bufferpublic byte get()
Bufferget in interface Bufferget in class AbstractBufferbyte value from the current getIndex.public int hashCode()
hashCode in class AbstractBufferpublic byte peek(int index)
Bufferindex - an int valuebyte valuepublic int peek(int index,
byte[] b,
int offset,
int length)
index - an int valueb - The byte array to peek intooffset - The offset into the array to start peekinglength - an int valuepublic void poke(int index,
byte b)
Bufferindex - an int valueb - a byte valuepublic 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 void writeTo(OutputStream out) throws IOException
BufferwriteTo in interface BufferwriteTo in class AbstractBufferIOExceptionpublic int readFrom(InputStream in, int max) throws IOException
BufferreadFrom in interface BufferreadFrom in class AbstractBufferin - input streammax - maximum number of bytes that may be readIOExceptionpublic int space()
Bufferspace in interface Bufferspace in class AbstractBufferCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.