|
JSON Version 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.jackson.util.TextBuffer
public final class TextBuffer
TextBuffer is a class similar to StringBuffer, with
following differences:
| Constructor Summary | |
|---|---|
TextBuffer(BufferRecycler allocator)
|
|
| Method Summary | |
|---|---|
void |
append(char[] c,
int start,
int len)
|
char[] |
contentsAsArray()
|
String |
contentsAsString()
|
int |
contentsToArray(int srcStart,
char[] dst,
int dstStart,
int len)
|
void |
ensureNotShared()
Method called to make sure that buffer is not using shared input buffer; if it is, it will copy such contents to private buffer. |
char[] |
finishCurrentSegment()
|
char[] |
getCurrentSegment()
|
int |
getCurrentSegmentSize()
|
char[] |
getTextBuffer()
|
int |
getTextOffset()
|
int |
rawContentsTo(Writer w)
Method that will stream contents of this buffer into specified Writer. |
void |
releaseBuffers()
Method called to indicate that the underlying buffers should now be recycled if they haven't yet been recycled. |
void |
resetWithCopy(char[] buf,
int start,
int len)
|
void |
resetWithEmpty()
Method called to clear out any content text buffer may have, and initializes buffer to use non-shared data. |
void |
resetWithShared(char[] buf,
int start,
int len)
Method called to initialize the buffer with a shared copy of data; this means that buffer will just have pointers to actual data. |
void |
resetWithString(String str)
|
void |
setCurrentLength(int len)
|
int |
size()
|
String |
toString()
Note: calling this method may not be as efficient as calling contentsAsString(), since it's not guaranteed that resulting
String is cached. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextBuffer(BufferRecycler allocator)
| Method Detail |
|---|
public void releaseBuffers()
public void resetWithEmpty()
public void resetWithShared(char[] buf,
int start,
int len)
public void resetWithCopy(char[] buf,
int start,
int len)
public void resetWithString(String str)
public int size()
public int getTextOffset()
public char[] getTextBuffer()
public String contentsAsString()
public char[] contentsAsArray()
public int contentsToArray(int srcStart,
char[] dst,
int dstStart,
int len)
public int rawContentsTo(Writer w)
throws IOException
IOExceptionpublic void ensureNotShared()
public void append(char[] c,
int start,
int len)
public char[] getCurrentSegment()
public int getCurrentSegmentSize()
public void setCurrentLength(int len)
public char[] finishCurrentSegment()
public String toString()
contentsAsString(), since it's not guaranteed that resulting
String is cached.
toString in class Object
|
JSON Version 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||