|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjebl.evolution.io.ByteBuilder
public class ByteBuilder
Similar to a StringBuilder, but its internal buffer is a byte[] with one entry for each character, so it can only correctly append single-byte characters.
Constructor Summary | |
---|---|
ByteBuilder(int maxCapacity)
Constructs a ByteBuilder that will never grow beyond maxCapacity
bytes in length. |
Method Summary | |
---|---|
ByteBuilder |
append(char c)
Appends an ASCII character (see isCharacterAscii(char) ) to this ByteBuilder. |
ByteBuilder |
append(java.lang.CharSequence charSequence)
Appends an ASCII CharSequence to this ByteBuilder. |
ByteBuilder |
append(java.lang.CharSequence csq,
int start,
int end)
|
char |
charAt(int index)
|
static boolean |
isCharacterAscii(char c)
|
int |
length()
|
java.lang.CharSequence |
subSequence(int start,
int end)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ByteBuilder(int maxCapacity)
maxCapacity
bytes in length. If you don't want to limit the size this ByteBuilder can
grow to, you should pass in Integer.MAX_VALUE here
maxCapacity
- The maximum, NOT the initial capacity of this ByteBuilderMethod Detail |
---|
public static boolean isCharacterAscii(char c)
public ByteBuilder append(char c)
isCharacterAscii(char)
) to this ByteBuilder.
append
in interface java.lang.Appendable
c
- ASCII character to append
java.lang.IllegalArgumentException
- if c is not an ASCII characterpublic ByteBuilder append(java.lang.CharSequence charSequence) throws java.io.IOException
append
in interface java.lang.Appendable
charSequence
- ASCII CharSequence to append
java.lang.IllegalArgumentException
- if charSequence contains non-ASCII characters
java.io.IOException
public ByteBuilder append(java.lang.CharSequence csq, int start, int end) throws java.io.IOException
append
in interface java.lang.Appendable
java.io.IOException
public int length()
length
in interface java.lang.CharSequence
public char charAt(int index)
charAt
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 |