public class SegmentCodec<B> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SegmentCodec.Header
Temporary holder for header data during decoding.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
CRC24_LENGTH |
static int |
CRC32_LENGTH |
| Constructor and Description |
|---|
SegmentCodec(PrimitiveCodec<B> primitiveCodec,
Compressor<B> compressor) |
| Modifier and Type | Method and Description |
|---|---|
Segment<B> |
decode(SegmentCodec.Header header,
B source)
Decodes the rest of a segment from a previously decoded header, and checks the payload's CRC.
|
SegmentCodec.Header |
decodeHeader(B source)
Decodes a segment header and checks its CRC.
|
void |
encode(Segment<B> segment,
List<Object> out) |
int |
headerLength()
The length of the segment header, excluding the 3-byte trailing CRC.
|
public static final int CRC24_LENGTH
public static final int CRC32_LENGTH
public SegmentCodec(PrimitiveCodec<B> primitiveCodec, Compressor<B> compressor)
public int headerLength()
public SegmentCodec.Header decodeHeader(B source) throws CrcMismatchException
CrcMismatchExceptionpublic Segment<B> decode(SegmentCodec.Header header, B source) throws CrcMismatchException
CrcMismatchExceptionCopyright © 2017–2022. All rights reserved.