T - element type.public interface Coder<T> extends Serializable
Coder<T> object encodes or decodes values of type T into byte streams.| Modifier and Type | Interface and Description |
|---|---|
static class |
Coder.DummyCoder
Dummy coder implementation which is not supposed to be used.
|
| Modifier and Type | Field and Description |
|---|---|
static Coder |
DUMMY_CODER
Dummy coder.
|
| Modifier and Type | Method and Description |
|---|---|
T |
decode(InputStream inStream)
Decodes the a value from the given input stream.
|
void |
encode(T element,
OutputStream outStream)
Encodes the given value onto the specified output stream.
|
static final Coder DUMMY_CODER
void encode(T element, OutputStream outStream) throws IOException
element - the element to be encodedoutStream - the stream on which encoded bytes are writtenIOException - if fail to encodeT decode(InputStream inStream) throws IOException
inStream - the stream from which bytes are readIOException - if fail to decodeCopyright © 2018. All rights reserved.