Decoder
s.
Factories are thread-safe, and are generally cached by applications for performance reasons. Multiple instances are only required if multiple concurrent configurations are needed.
Decoder
Modifier and Type | Class and Description |
---|---|
private static class |
Modifier and Type | Field and Description |
---|---|
pack-priv int | |
pack-priv static final int | |
private static final DecoderFactory |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public BinaryDecoder | Returns: A BinaryDecoder that uses in as its source of data. If reuse is null, this will be a new instance. If reuse is not null, then it may be reinitialized if compatible, otherwise a new instance will be returned.The InputStream to initialize to in, BinaryDecoder The BinaryDecoder to attempt to reuse given the factory
configuration. A BinaryDecoder implementation may not be
compatible with reuse, causing a new instance to be returned. If
null, a new instance is returned. reuse)Creates or reinitializes a |
public BinaryDecoder | Returns: A BinaryDecoder that uses bytes as its source of data. If reuse is null, this will be a new instance. reuse may be reinitialized if appropriate, otherwise a new instance is returned. Clients must not assume that reuse is reinitialized and returned.The byte array to initialize to bytes, int The offset to start reading from offset, int The maximum number of bytes to read from the byte array length, BinaryDecoder The BinaryDecoder to attempt to reinitialize. if null a new
BinaryDecoder is created. reuse)Creates or reinitializes a |
public BinaryDecoder | binaryDecoder(byte[] bytes, BinaryDecoder reuse)
This method is shorthand for createBinaryDecoder(bytes, 0, bytes.length, reuse); |
public DecoderFactory | Returns: This factory, to enable method chaining:DecoderFactory myFactory = new DecoderFactory().useBinaryDecoderBufferSize(4096); The preferred buffer size. Valid values are in the range [32,
16*1024*1024]. Values outside this range are rounded to the
nearest value in the range. Values less than 512 or greater than
1024*1024 are not recommended. size)Configures this factory to use the specified buffer size when creating Decoder instances that buffer their input. |
public BinaryDecoder | createBinaryDecoder(InputStream in, BinaryDecoder reuse)
Deprecated
use the equivalent
binaryDecoder(InputStream, BinaryDecoder) instead
|
public BinaryDecoder | createBinaryDecoder(byte[] bytes, int offset, int length, BinaryDecoder reuse)
Deprecated
use
binaryDecoder(byte[], int, int, BinaryDecoder)
instead
|
public BinaryDecoder | createBinaryDecoder(byte[] bytes, BinaryDecoder reuse)
Deprecated
use
binaryDecoder(byte[], BinaryDecoder) instead
|
public static DecoderFactory | |
public BinaryDecoder | Returns: A BinaryDecoder that uses in as its source of data. If reuse is null, this will be a new instance. If reuse is not null, then it may be reinitialized if compatible, otherwise a new instance will be returned.The InputStream to initialize to in, BinaryDecoder The BinaryDecoder to attempt to reuse given the factory
configuration. A BinaryDecoder implementation may not be
compatible with reuse, causing a new instance to be returned. If
null, a new instance is returned. reuse)Creates or reinitializes a |
public static DecoderFactory | get()
Returns an immutable static DecoderFactory configured with default settings All mutating methods throw IllegalArgumentExceptions. |
public int | Returns: The preferred buffer size, in bytes.Returns this factory's configured preferred buffer size. |
public JsonDecoder | Returns: A JsonEncoder configured with input and schemaThe Schema for data read from this JsonEncoder. Cannot be null. schema, InputStream The InputStream to read from. Cannot be null. input)Creates a |
public JsonDecoder | Returns: A JsonEncoder configured with input and schemaThe Schema for data read from this JsonEncoder. Cannot be null. schema, String The String to read from. Cannot be null. input)Creates a |
public ResolvingDecoder | Returns: A ResolvingDecoder configured to resolve writer to reader from inThe Schema that the source data is in. Cannot be null. writer, Schema The Schema that the reader wishes to read the data as. Cannot
be null. reader, Decoder The Decoder to wrap. wrapped)Creates a |
public ValidatingDecoder | Returns: A ValidatingDecoder configured with wrapped and schemaThe Schema to validate against. Cannot be null. schema, Decoder The Decoder to wrap. wrapped)Creates a |
binaryDecoderBufferSize | back to summary |
---|---|
pack-priv int binaryDecoderBufferSize |
DEFAULT_BUFFER_SIZE | back to summary |
---|---|
pack-priv static final int DEFAULT_BUFFER_SIZE |
DEFAULT_FACTORY | back to summary |
---|---|
private static final DecoderFactory DEFAULT_FACTORY |
DecoderFactory | back to summary |
---|---|
public DecoderFactory() Constructor for factory instances |
binaryDecoder | back to summary |
---|---|
public BinaryDecoder binaryDecoder(InputStream in, BinaryDecoder reuse) Creates or reinitializes a
|
binaryDecoder | back to summary |
---|---|
public BinaryDecoder binaryDecoder(byte[] bytes, int offset, int length, BinaryDecoder reuse) Creates or reinitializes a
|
binaryDecoder | back to summary |
---|---|
public BinaryDecoder binaryDecoder(byte[] bytes, BinaryDecoder reuse) This method is shorthand for createBinaryDecoder(bytes, 0, bytes.length, reuse); binaryDecoder(byte[], int, int, BinaryDecoder)
|
configureDecoderBufferSize | back to summary |
---|---|
public DecoderFactory configureDecoderBufferSize(int size) Configures this factory to use the specified buffer size when creating Decoder instances that buffer their input. The default buffer size is 8192 bytes.
|
createBinaryDecoder | back to summary |
---|---|
public BinaryDecoder createBinaryDecoder(InputStream in, BinaryDecoder reuse)
Deprecated use the equivalent
|
createBinaryDecoder | back to summary |
---|---|
public BinaryDecoder createBinaryDecoder(byte[] bytes, int offset, int length, BinaryDecoder reuse)
Deprecated use
|
createBinaryDecoder | back to summary |
---|---|
public BinaryDecoder createBinaryDecoder(byte[] bytes, BinaryDecoder reuse)
Deprecated use
|
defaultFactory | back to summary |
---|---|
public static DecoderFactory defaultFactory()
Deprecated use the equivalent
|
directBinaryDecoder | back to summary |
---|---|
public BinaryDecoder directBinaryDecoder(InputStream in, BinaryDecoder reuse) Creates or reinitializes a
A "direct" BinaryDecoder does not read ahead from an InputStream or other
data source that cannot be rewound. From the perspective of a client, a
"direct" decoder must never read beyond the minimum necessary bytes to
service a In the case that the improved performance of a buffering implementation does not outweigh the inconvenience of its buffering semantics, a "direct" decoder can be used.
|
get | back to summary |
---|---|
public static DecoderFactory get() Returns an immutable static DecoderFactory configured with default settings All mutating methods throw IllegalArgumentExceptions. All creator methods create objects with default settings. |
getConfiguredBufferSize | back to summary |
---|---|
public int getConfiguredBufferSize() Returns this factory's configured preferred buffer size. Used when creating
Decoder instances that buffer. See
|
jsonDecoder | back to summary |
---|---|
public JsonDecoder jsonDecoder(Schema schema, InputStream input) throws IOException Creates a
|
jsonDecoder | back to summary |
---|---|
public JsonDecoder jsonDecoder(Schema schema, String input) throws IOException Creates a
|
resolvingDecoder | back to summary |
---|---|
public ResolvingDecoder resolvingDecoder(Schema writer, Schema reader, Decoder wrapped) throws IOException Creates a
|
validatingDecoder | back to summary |
---|---|
public ValidatingDecoder validatingDecoder(Schema schema, Decoder wrapped) throws IOException Creates a
|
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public DecoderFactory | configureDecoderBufferSize(int
The preferred buffer size. Valid values are in the range [32,
16*1024*1024]. Values outside this range are rounded to the
nearest value in the range. Values less than 512 or greater than
1024*1024 are not recommended. bufferSize)Overrides org. |
DefaultDecoderFactory | back to summary |
---|---|
private DefaultDecoderFactory() |
configureDecoderBufferSize | back to summary |
---|---|
public DecoderFactory configureDecoderBufferSize(int bufferSize) Overrides org. Doc from org. Configures this factory to use the specified buffer size when creating Decoder instances that buffer their input. The default buffer size is 8192 bytes.
|