public class HybridChunkCodec2 extends Object implements ChunkCodec
| Modifier and Type | Field and Description |
|---|---|
static byte |
REGISTRATION_CODE |
| Constructor and Description |
|---|
HybridChunkCodec2() |
| Modifier and Type | Method and Description |
|---|---|
com.google.protobuf.Message |
decode(byte[] bytes)
Decode the bytes to collection.
|
ByteArrayOutputStream |
encode(com.google.protobuf.Message readCollection)
Encode the protobuff collection to a byte of stream.
|
int |
getSuggestedChunkSize()
Return a suggestion for chunk size, to be used as default.
|
String |
name()
Return the name of this codec.
|
byte |
registrationCode()
Return the registration code of this codec, a byte that uniquely identifies this codec.
|
void |
setHandler(ProtobuffCollectionHandler handler) |
boolean |
validate(byte firstByte,
DataInputStream input)
Validate that the input stream is at the start of a chunk encoded with this codec.
|
public static final byte REGISTRATION_CODE
public String name()
ChunkCodecname in interface ChunkCodecpublic byte registrationCode()
ChunkCodecregistrationCode in interface ChunkCodecpublic ByteArrayOutputStream encode(com.google.protobuf.Message readCollection) throws IOException
ChunkCodecencode in interface ChunkCodecIOExceptionpublic com.google.protobuf.Message decode(byte[] bytes)
throws IOException
ChunkCodecdecode in interface ChunkCodecbytes - bytes for codec compressed stream.IOExceptionpublic int getSuggestedChunkSize()
ChunkCodecgetSuggestedChunkSize in interface ChunkCodecpublic void setHandler(ProtobuffCollectionHandler handler)
setHandler in interface ChunkCodecpublic boolean validate(byte firstByte,
DataInputStream input)
ChunkCodecvalidate in interface ChunkCodecinput - input stream positioned at the start of the chunk.Copyright © 2018 Campagne Laboratory. All rights reserved.