Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.coders
Class TextualIntegerCoder
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.coders.StandardCoder<T>
-
- com.google.cloud.dataflow.sdk.coders.DeterministicStandardCoder<T>
-
- com.google.cloud.dataflow.sdk.coders.AtomicCoder<Integer>
-
- com.google.cloud.dataflow.sdk.coders.TextualIntegerCoder
-
- All Implemented Interfaces:
- Coder<Integer>, Serializable
public class TextualIntegerCoder extends AtomicCoder<Integer>
ACoder
that encodesInteger Integers
as the ASCII bytes of their textual, decimal, representation.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.cloud.dataflow.sdk.coders.Coder
Coder.Context, Coder.NonDeterministicException
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
TextualIntegerCoder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Integer
decode(InputStream inStream, Coder.Context context)
Decodes a value of typeT
from the given input stream in the given context.void
encode(Integer value, OutputStream outStream, Coder.Context context)
Encodes the given value of typeT
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()
-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.AtomicCoder
getCoderArguments, getInstanceComponents
-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.DeterministicStandardCoder
verifyDeterministic
-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.StandardCoder
asCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministic
-
-
-
-
Method Detail
-
of
public static TextualIntegerCoder of()
-
encode
public void encode(Integer value, OutputStream outStream, Coder.Context context) throws IOException, CoderException
Description copied from interface:Coder
Encodes the given value of typeT
onto the given output stream in the given context.- Throws:
IOException
- if writing to theOutputStream
fails for some reasonCoderException
- if the value could not be encoded for some reason
-
decode
public Integer decode(InputStream inStream, Coder.Context context) throws IOException, CoderException
Description copied from interface:Coder
Decodes a value of typeT
from the given input stream in the given context. Returns the decoded value.- Throws:
IOException
- if reading from theInputStream
fails for some reasonCoderException
- if the value could not be decoded for some reason
-
getEncodedElementByteSize
protected long getEncodedElementByteSize(Integer value, Coder.Context context) throws Exception
Description copied from class:StandardCoder
Returns the size in bytes of the encoded value using this coder.- Overrides:
getEncodedElementByteSize
in classStandardCoder<Integer>
- Throws:
Exception
-
-