public class DoubleCoder extends AtomicCoder<java.lang.Double>
Coder.Context| Modifier and Type | Method and Description |
|---|---|
java.lang.Double |
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.Double 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.Double value,
Coder.Context context)
Returns the size in bytes of the encoded value using this
coder.
|
boolean |
isDeterministic()
Floating-point operations are not guaranteed to be deterministic, even
if the storage format might be, so floating point representations are not
recommended for use in operations which require deterministic inputs.
|
boolean |
isRegisterByteSizeObserverCheap(java.lang.Double value,
Coder.Context context)
Returns true since registerByteSizeObserver() runs in constant time.
|
static DoubleCoder |
of() |
getCoderArguments, getInstanceComponentsasCloudObject, equals, getComponents, hashCode, registerByteSizeObserver, toStringpublic static DoubleCoder of()
public void encode(java.lang.Double value,
java.io.OutputStream outStream,
Coder.Context context)
throws java.io.IOException,
CoderException
CoderT onto the given output stream
in the given context.java.io.IOException - if writing to the OutputStream fails
for some reasonCoderException - if the value could not be encoded for some reasonpublic java.lang.Double decode(java.io.InputStream inStream,
Coder.Context context)
throws java.io.IOException,
CoderException
CoderT from the given input stream in
the given context. Returns the decoded value.java.io.IOException - if reading from the InputStream fails
for some reasonCoderException - if the value could not be decoded for some reasonpublic boolean isDeterministic()
public boolean isRegisterByteSizeObserverCheap(java.lang.Double value,
Coder.Context context)
isRegisterByteSizeObserverCheap in interface Coder<java.lang.Double>isRegisterByteSizeObserverCheap in class StandardCoder<java.lang.Double>protected long getEncodedElementByteSize(java.lang.Double value,
Coder.Context context)
throws java.lang.Exception
StandardCodergetEncodedElementByteSize in class StandardCoder<java.lang.Double>java.lang.Exception