|
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.io.IOContext
public final class IOContext
To limit number of configuration and state objects to pass, all contextual objects that need to be passed by the factory to readers and writers are combined under this object. One instance is created for each reader and writer.
Field Summary | |
---|---|
protected char[] |
mConcatBuffer
Reference to the buffer allocated for buffering it for output, before being encoded: generally this means concatenating output, then encoding when buffer fills up. |
protected String |
mEncoding
Encoding used by the underlying stream, if known. |
protected byte[] |
mReadIOBuffer
Reference to the allocated I/O buffer for low-level input reading, if any allocated. |
protected char[] |
mTokenBuffer
Reference to the buffer allocated for tokenization purposes, in which character input is read, and from which it can be further returned. |
protected byte[] |
mWriteIOBuffer
Reference to the allocated I/O buffer for low-level input writing if any allocated. |
Constructor Summary | |
---|---|
IOContext(BufferRecycler br,
Object sourceRef)
|
Method Summary | |
---|---|
char[] |
allocConcatBuffer()
|
byte[] |
allocReadIOBuffer()
Note: the method can only be called once during its life cycle. |
char[] |
allocTokenBuffer()
|
byte[] |
allocWriteIOBuffer()
|
TextBuffer |
constructTextBuffer()
|
String |
getEncoding()
|
Object |
getSourceReference()
|
void |
releaseConcatBuffer(char[] buf)
|
void |
releaseReadIOBuffer(byte[] buf)
Method to call when all the processing buffers can be safely recycled. |
void |
releaseTokenBuffer(char[] buf)
|
void |
releaseWriteIOBuffer(byte[] buf)
|
void |
setEncoding(String enc)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String mEncoding
protected byte[] mReadIOBuffer
protected byte[] mWriteIOBuffer
protected char[] mTokenBuffer
protected char[] mConcatBuffer
Constructor Detail |
---|
public IOContext(BufferRecycler br, Object sourceRef)
Method Detail |
---|
public void setEncoding(String enc)
public TextBuffer constructTextBuffer()
public byte[] allocReadIOBuffer()
Note: the method can only be called once during its life cycle. This is to protect against accidental sharing.
public byte[] allocWriteIOBuffer()
public char[] allocTokenBuffer()
public char[] allocConcatBuffer()
public void releaseReadIOBuffer(byte[] buf)
public void releaseWriteIOBuffer(byte[] buf)
public void releaseTokenBuffer(char[] buf)
public void releaseConcatBuffer(char[] buf)
public Object getSourceReference()
public String getEncoding()
|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |