public class VoidCoder extends AtomicCoder<java.lang.Void>
Coder.Context| Modifier and Type | Method and Description |
|---|---|
java.lang.Void |
decode(java.io.InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(java.lang.Void value,
java.io.OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
protected long |
getEncodedElementByteSize(java.lang.Void value,
Coder.Context context)
Returns the size in bytes of the encoded value using this
coder.
|
boolean |
isDeterministic()
Returns true if the coding is deterministic.
|
boolean |
isRegisterByteSizeObserverCheap(java.lang.Void value,
Coder.Context context)
Returns true since registerByteSizeObserver() runs in constant time.
|
static VoidCoder |
of() |
getCoderArguments, getInstanceComponentsasCloudObject, equals, getComponents, hashCode, registerByteSizeObserver, toStringpublic static VoidCoder of()
public void encode(java.lang.Void value,
java.io.OutputStream outStream,
Coder.Context context)
CoderT onto the given output stream
in the given context.public java.lang.Void decode(java.io.InputStream inStream,
Coder.Context context)
CoderT from the given input stream in
the given context. Returns the decoded value.public boolean isDeterministic()
Coder In order for a Coder to be considered deterministic,
the following must be true:
Object.equals()
or Comparable.compareTo(), if supported), have the same
encoding.
Coder always produces a canonical encoding, which is the
same for an instance of an object even if produced on different
computers at different times.
public boolean isRegisterByteSizeObserverCheap(java.lang.Void value,
Coder.Context context)
isRegisterByteSizeObserverCheap in interface Coder<java.lang.Void>isRegisterByteSizeObserverCheap in class StandardCoder<java.lang.Void>protected long getEncodedElementByteSize(java.lang.Void value,
Coder.Context context)
throws java.lang.Exception
StandardCodergetEncodedElementByteSize in class StandardCoder<java.lang.Void>java.lang.Exception