Class JFIFOutputStream
java.lang.Object
java.io.OutputStream
org.monte.media.jfif.JFIFOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
JFIFOutputStream.
This OutputStream supports writing of a JFIF stream.
References:
JPEG File Interchange Format Version 1.02
http://www.jpeg.org/public/jfif.pdf
Pennebaker, W., Mitchell, J. (1993).
JPEG Still Image Data Compression Standard.
Chapmann & Hall, New York.
ISBN 0-442-01272-1
- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAPP1_MARKER Reserved for application usestatic final intAPP2_MARKER Reserved for application usestatic final intEnd of imagestatic final intReserved for JPEG extensionsstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intStart of frame markersstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intStart of imagestatic final intStart of scanstatic final intTemporary private use in arithmetic coding -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfinish()longReturns the length of the current segment or -1 if none has been pushed.longReturns the offset of the current segment or -1 if none has been pushed.longGets the position relative to the beginning of the IFF output stream.voidvoidpushSegment(int marker) voidseek(long newPosition) Seeks relative to the beginning of the IFF output stream.voidwrite(byte[] b, int off, int len) Writes stuffed or non-stuffed bytes to the underlying output stream.voidwrite(int b) Writes a stuffed or non-stuffed byte to the underlying output stream.Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
SOI_MARKER
public static final int SOI_MARKERStart of image- See Also:
-
EOI_MARKER
public static final int EOI_MARKEREnd of image- See Also:
-
TEM_MARKER
public static final int TEM_MARKERTemporary private use in arithmetic coding- See Also:
-
SOS_MARKER
public static final int SOS_MARKERStart of scan- See Also:
-
APP1_MARKER
public static final int APP1_MARKERAPP1_MARKER Reserved for application use- See Also:
-
APP2_MARKER
public static final int APP2_MARKERAPP2_MARKER Reserved for application use- See Also:
-
JPG0_MARKER
public static final int JPG0_MARKERReserved for JPEG extensions- See Also:
-
JPG1_MARKER
public static final int JPG1_MARKER- See Also:
-
JPG2_MARKER
public static final int JPG2_MARKER- See Also:
-
JPG3_MARKER
public static final int JPG3_MARKER- See Also:
-
JPG4_MARKER
public static final int JPG4_MARKER- See Also:
-
JPG5_MARKER
public static final int JPG5_MARKER- See Also:
-
JPG6_MARKER
public static final int JPG6_MARKER- See Also:
-
JPG7_MARKER
public static final int JPG7_MARKER- See Also:
-
JPG8_MARKER
public static final int JPG8_MARKER- See Also:
-
JPG9_MARKER
public static final int JPG9_MARKER- See Also:
-
JPGA_MARKER
public static final int JPGA_MARKER- See Also:
-
JPGB_MARKER
public static final int JPGB_MARKER- See Also:
-
JPGC_MARKER
public static final int JPGC_MARKER- See Also:
-
JPGD_MARKER
public static final int JPGD_MARKER- See Also:
-
SOF0_MARKER
public static final int SOF0_MARKERStart of frame markers- See Also:
-
SOF1_MARKER
public static final int SOF1_MARKER- See Also:
-
SOF2_MARKER
public static final int SOF2_MARKER- See Also:
-
SOF3_MARKER
public static final int SOF3_MARKER- See Also:
-
SOF5_MARKER
public static final int SOF5_MARKER- See Also:
-
SOF6_MARKER
public static final int SOF6_MARKER- See Also:
-
SOF7_MARKER
public static final int SOF7_MARKER- See Also:
-
SOF9_MARKER
public static final int SOF9_MARKER- See Also:
-
SOFA_MARKER
public static final int SOFA_MARKER- See Also:
-
SOFB_MARKER
public static final int SOFB_MARKER- See Also:
-
SOFD_MARKER
public static final int SOFD_MARKER- See Also:
-
SOFE_MARKER
public static final int SOFE_MARKER- See Also:
-
SOFF_MARKER
public static final int SOFF_MARKER- See Also:
-
RST0_MARKER
public static final int RST0_MARKER- See Also:
-
RST1_MARKER
public static final int RST1_MARKER- See Also:
-
RST2_MARKER
public static final int RST2_MARKER- See Also:
-
RST3_MARKER
public static final int RST3_MARKER- See Also:
-
RST4_MARKER
public static final int RST4_MARKER- See Also:
-
RST5_MARKER
public static final int RST5_MARKER- See Also:
-
RST6_MARKER
public static final int RST6_MARKER- See Also:
-
RST7_MARKER
public static final int RST7_MARKER- See Also:
-
-
Constructor Details
-
JFIFOutputStream
- Throws:
IOException
-
JFIFOutputStream
- Throws:
IOException
-
-
Method Details
-
getStreamPosition
Gets the position relative to the beginning of the IFF output stream.Usually this value is equal to the stream position of the underlying ImageOutputStream, but can be larger if the underlying stream already contained data.
- Returns:
- The relative stream position.
- Throws:
IOException
-
seek
Seeks relative to the beginning of the IFF output stream.Usually this equal to seeking in the underlying ImageOutputStream, but can be different if the underlying stream already contained data.
- Throws:
IOException
-
pushSegment
- Throws:
IOException
-
popSegment
- Throws:
IOException
-
getSegmentOffset
Returns the offset of the current segment or -1 if none has been pushed.- Throws:
IOException
-
getSegmentLength
Returns the length of the current segment or -1 if none has been pushed.- Throws:
IOException
-
finish
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
Writes stuffed or non-stuffed bytes to the underlying output stream. Bytes are stuffed, if the stream is not currently in a segment.- Overrides:
writein classOutputStream- Throws:
IOException
-
write
Writes a stuffed or non-stuffed byte to the underlying output stream. Bytes are stuffed, if the stream is not currently in a segment.- Specified by:
writein classOutputStream- Throws:
IOException
-