Class AbstractGenericSegment
java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.jpeg.segments.AbstractSegment
org.apache.commons.imaging.formats.jpeg.segments.AbstractGenericSegment
- Direct Known Subclasses:
AppnSegment, ComSegment, UnknownSegment
-
Field Summary
FieldsFields inherited from class AbstractSegment
length, marker -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGenericSegment(int marker, byte[] bytes) AbstractGenericSegment(int marker, int markerLength, InputStream is) -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintWriter pw) voiddump(PrintWriter pw, int start) byte[]Returns a copy of the segment's contents, excluding the marker and length bytes at the beginning.protected bytegetSegmentData(int offset) Returns a specific byte of the segment's contents, excluding the marker and length bytes at the beginning.getSegmentDataAsString(Charset encoding) Convert the bytes to a StringMethods inherited from class AbstractSegment
getDescription, getSegmentType, toStringMethods inherited from class BinaryFileParser
debugNumber, debugNumber, getByteOrder, setByteOrder
-
Field Details
-
segmentData
private final byte[] segmentData
-
-
Constructor Details
-
AbstractGenericSegment
public AbstractGenericSegment(int marker, byte[] bytes) -
AbstractGenericSegment
- Throws:
IOException
-
-
Method Details
-
dump
- Overrides:
dumpin classAbstractSegment
-
dump
-
getSegmentData
public byte[] getSegmentData()Returns a copy of the segment's contents, excluding the marker and length bytes at the beginning.- Returns:
- the segment's contents
-
getSegmentData
protected byte getSegmentData(int offset) Returns a specific byte of the segment's contents, excluding the marker and length bytes at the beginning.- Parameters:
offset- segment offset- Returns:
- the bye in the segment's contents
- See Also:
-
getSegmentDataAsString
-