public class IOContext
extends java.lang.Object
NOTE: non-final since 2.4, to allow sub-classing.
Constructor and Description |
---|
IOContext(BufferRecycler br,
ContentReference contentRef,
boolean managedResource)
Main constructor to use.
|
IOContext(BufferRecycler br,
java.lang.Object rawContent,
boolean managedResource)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
allocBase64Buffer()
Method for recycling or allocation byte buffer of "base 64 encode/decode" type.
|
byte[] |
allocBase64Buffer(int minSize)
Variant of
allocBase64Buffer() that specifies smallest acceptable
buffer size. |
char[] |
allocConcatBuffer() |
char[] |
allocNameCopyBuffer(int minSize) |
byte[] |
allocReadIOBuffer()
Method for recycling or allocation byte buffer of "read I/O" type.
|
byte[] |
allocReadIOBuffer(int minSize)
Variant of
allocReadIOBuffer() that specifies smallest acceptable
buffer size. |
char[] |
allocTokenBuffer() |
char[] |
allocTokenBuffer(int minSize) |
byte[] |
allocWriteEncodingBuffer()
Method for recycling or allocation byte buffer of "write encoding" type.
|
byte[] |
allocWriteEncodingBuffer(int minSize)
Variant of
allocWriteEncodingBuffer() that specifies smallest acceptable
buffer size. |
TextBuffer |
constructTextBuffer() |
ContentReference |
contentReference()
Accessor for getting (some) information about input source, mostly
usable for error reporting purposes.
|
JsonEncoding |
getEncoding() |
java.lang.Object |
getSourceReference()
Deprecated.
Since 2.13, use
contentReference() instead |
boolean |
isResourceManaged() |
void |
releaseBase64Buffer(byte[] buf) |
void |
releaseConcatBuffer(char[] buf) |
void |
releaseNameCopyBuffer(char[] buf) |
void |
releaseReadIOBuffer(byte[] buf)
Method to call when all the processing buffers can be safely
recycled.
|
void |
releaseTokenBuffer(char[] buf) |
void |
releaseWriteEncodingBuffer(byte[] buf) |
void |
setEncoding(JsonEncoding enc) |
IOContext |
withEncoding(JsonEncoding enc) |
public IOContext(BufferRecycler br, ContentReference contentRef, boolean managedResource)
br
- BufferRecycler to use, if any (null
if none)contentRef
- Input source reference for location reportingmanagedResource
- Whether input source is managed (owned) by Jackson library@Deprecated public IOContext(BufferRecycler br, java.lang.Object rawContent, boolean managedResource)
public void setEncoding(JsonEncoding enc)
public IOContext withEncoding(JsonEncoding enc)
public JsonEncoding getEncoding()
public boolean isResourceManaged()
public ContentReference contentReference()
@Deprecated public java.lang.Object getSourceReference()
contentReference()
insteadpublic 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[] allocReadIOBuffer(int minSize)
allocReadIOBuffer()
that specifies smallest acceptable
buffer size.minSize
- Minimum size of the buffer to recycle or allocatepublic byte[] allocWriteEncodingBuffer()
Note: the method can only be called once during its life cycle. This is to protect against accidental sharing.
public byte[] allocWriteEncodingBuffer(int minSize)
allocWriteEncodingBuffer()
that specifies smallest acceptable
buffer size.minSize
- Minimum size of the buffer to recycle or allocatepublic byte[] allocBase64Buffer()
Note: the method can only be called once during its life cycle. This is to protect against accidental sharing.
public byte[] allocBase64Buffer(int minSize)
allocBase64Buffer()
that specifies smallest acceptable
buffer size.minSize
- Minimum size of the buffer to recycle or allocatepublic char[] allocTokenBuffer()
public char[] allocTokenBuffer(int minSize)
public char[] allocConcatBuffer()
public char[] allocNameCopyBuffer(int minSize)
public void releaseReadIOBuffer(byte[] buf)
buf
- Buffer instance to release (return for recycling)public void releaseWriteEncodingBuffer(byte[] buf)
public void releaseBase64Buffer(byte[] buf)
public void releaseTokenBuffer(char[] buf)
public void releaseConcatBuffer(char[] buf)
public void releaseNameCopyBuffer(char[] buf)
Copyright © 2010 - 2023 Adobe. All Rights Reserved