public class TextualIntegerCoder extends AtomicCoder<Integer>
Coder that encodes Integer Integers as the ASCII bytes of
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() |
getCoderArguments, getInstanceComponentsverifyDeterministicasCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodingId, 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 reasonprotected long getEncodedElementByteSize(Integer value, Coder.Context context) throws Exception
StandardCodergetEncodedElementByteSize in class StandardCoder<Integer>Exception