|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ajax4jsf.io.ByteBuffer
public class ByteBuffer
A single link in chain of byte arrays.
Constructor Summary | |
---|---|
ByteBuffer(byte[] bytes)
Creates instance of ByteBuffer already filled by bytes. |
|
ByteBuffer(int cacheSize)
Creates instance of ByteBuffer with byte array of required length. |
Method Summary | |
---|---|
ByteBuffer |
append(byte c)
Appends byte to array if there are unfilled positions in it. |
ByteBuffer |
append(byte[] bs,
int off,
int len)
Appends segment of a byte array to array if there are unfilled positions in it. |
void |
compact()
|
byte |
getByteAt(int index)
Returns byte at index. |
byte[] |
getBytes()
Returns stored byte array. |
int |
getCacheSize()
Returns capacity of this link. |
ByteBuffer |
getNext()
Returns the next link in the chain. |
ByteBuffer |
getPrevious()
Returns the previous link in the chain. |
int |
getTotalSize()
Returns total number of bytes stored in this link and all its predecessors. |
int |
getUsedSize()
Returns actual number of byte stored in this link. |
void |
reset()
Resets this byte buffer to empty state |
void |
setNext(ByteBuffer b)
Sets the next link in the chain. |
CharBuffer |
toCharBuffer()
Transforms this instance to instance of CharBuffer (a link of chain of char arrays). |
CharBuffer |
toCharBuffer(String encoding)
Transforms this instance to instance of CharBuffer (a link of chain of char arrays). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteBuffer(byte[] bytes)
bytes
- public ByteBuffer(int cacheSize)
cacheSize
- length of byte arrayMethod Detail |
---|
public ByteBuffer append(byte c)
c
-
public ByteBuffer append(byte[] bs, int off, int len)
c
-
public byte[] getBytes()
public byte getByteAt(int index)
index
-
public int getUsedSize()
public int getCacheSize()
public int getTotalSize()
public ByteBuffer getPrevious()
public ByteBuffer getNext()
public void setNext(ByteBuffer b)
b
- public CharBuffer toCharBuffer(String encoding) throws UnsupportedEncodingException
encoding
-
UnsupportedEncodingException
public CharBuffer toCharBuffer()
public void reset()
public void compact()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |