|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.freecompany.util.text.ByteBufferWrapper
public class ByteBufferWrapper
This class provides a wrapper view of a buffer of bytes as a sequence of US-ASCII characters. This is appropriate for treating a buffer of bytes like a buffer of characters when it is known that it contains only 7 bit characters.
Field Summary | |
---|---|
protected java.nio.ByteBuffer |
buffer
|
Constructor Summary | |
---|---|
ByteBufferWrapper(java.nio.ByteBuffer buffer)
|
Method Summary | |
---|---|
char |
charAt(int index)
Returns the character at the provided index in the backing byte buffer, respective of the current buffer position. |
java.nio.ByteBuffer |
getBuffer()
|
int |
length()
Returns the perceived length of this character sequence, which in this case is the number of bytes between the position and limit of the backing buffer. |
java.lang.CharSequence |
subSequence(int start,
int end)
Creates a new wrapped slice of the buffer given position and limit values derived from the provided start and end indexes. |
java.lang.String |
toString()
Creates a UTF-8 decoded string representation of this byte buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.nio.ByteBuffer buffer
Constructor Detail |
---|
public ByteBufferWrapper(java.nio.ByteBuffer buffer)
Method Detail |
---|
public java.nio.ByteBuffer getBuffer()
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public int length()
length
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |