public static class ExtraField.AlignmentSegment extends java.lang.Object implements ExtraField.Segment
An alignment segment contains the header ID, the size of the data, the alignment value and zero bytes to pad
| Modifier and Type | Field and Description |
|---|---|
static int |
MINIMUM_SIZE
Minimum size for an alignment segment.
|
| Constructor and Description |
|---|
AlignmentSegment(int headerId,
byte[] data)
Creates a new alignment segment from extra data.
|
AlignmentSegment(int alignment,
int totalSize)
Creates a new alignment segment.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getHeaderId()
Obtains the segment's header ID.
|
int |
size()
Obtains the size of the segment including the header ID.
|
void |
write(java.nio.ByteBuffer out)
Writes the segment to a buffer.
|
public static final int MINIMUM_SIZE
public AlignmentSegment(int alignment,
int totalSize)
alignment - the alignment valuetotalSize - how many bytes should this segment take?public AlignmentSegment(int headerId,
byte[] data)
throws java.io.IOException
headerId - the header IDdata - the segment datajava.io.IOException - failed to create the segment from the datapublic void write(java.nio.ByteBuffer out)
throws java.io.IOException
ExtraField.Segmentwrite in interface ExtraField.Segmentout - the buffer where to write the segment to; exactly ExtraField.Segment.size() bytes will be
writtenjava.io.IOException - failed to write segment datapublic int size()
ExtraField.Segmentsize in interface ExtraField.Segmentpublic int getHeaderId()
ExtraField.SegmentgetHeaderId in interface ExtraField.Segment