public class TextualIntegerCoder extends AtomicCoder<Integer>
TextualIntegerCoder encodes Integers
as their textual, decimal, representation.Coder.Context, Coder.NonDeterministicException| Modifier | Constructor and Description |
|---|---|
protected |
TextualIntegerCoder() |
| Modifier and Type | Method and Description |
|---|---|
Integer |
decode(InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(Integer value,
OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
protected long |
getEncodedElementByteSize(Integer value,
Coder.Context context)
Returns the size in bytes of the encoded value using this
coder.
|
static TextualIntegerCoder |
of() |
void |
verifyDeterministic()
As a
DeterministicStandardCoder is presumed deterministic, this
method does nothing. |
getCoderArguments, getInstanceComponentsasCloudObject, consistentWithEquals, equals, getComponents, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static TextualIntegerCoder of()
public void encode(Integer value, OutputStream outStream, Coder.Context context) throws IOException, CoderException
CoderT onto the given output stream
in the given context.IOException - if writing to the OutputStream fails
for some reasonCoderException - if the value could not be encoded for some reasonpublic Integer decode(InputStream inStream, Coder.Context context) throws IOException, CoderException
CoderT from the given input stream in
the given context. Returns the decoded value.IOException - if reading from the InputStream fails
for some reasonCoderException - if the value could not be decoded for some reasonpublic void verifyDeterministic()
DeterministicStandardCoderDeterministicStandardCoder is presumed deterministic, this
method does nothing.verifyDeterministic in interface Coder<Integer>verifyDeterministic in class DeterministicStandardCoder<Integer>protected long getEncodedElementByteSize(Integer value, Coder.Context context) throws Exception
StandardCodergetEncodedElementByteSize in class StandardCoder<Integer>Exception