public class JFIFOutputStream extends OutputStream
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
| Modifier and Type | Field and Description |
|---|---|
static int |
APP1_MARKER
APP1_MARKER Reserved for application use
|
static int |
APP2_MARKER
APP2_MARKER Reserved for application use
|
static int |
EOI_MARKER
End of image
|
static int |
JPG0_MARKER
Reserved for JPEG extensions
|
static int |
JPG1_MARKER |
static int |
JPG2_MARKER |
static int |
JPG3_MARKER |
static int |
JPG4_MARKER |
static int |
JPG5_MARKER |
static int |
JPG6_MARKER |
static int |
JPG7_MARKER |
static int |
JPG8_MARKER |
static int |
JPG9_MARKER |
static int |
JPGA_MARKER |
static int |
JPGB_MARKER |
static int |
JPGC_MARKER |
static int |
JPGD_MARKER |
static int |
RST0_MARKER |
static int |
RST1_MARKER |
static int |
RST2_MARKER |
static int |
RST3_MARKER |
static int |
RST4_MARKER |
static int |
RST5_MARKER |
static int |
RST6_MARKER |
static int |
RST7_MARKER |
static int |
SOF0_MARKER
Start of frame markers
|
static int |
SOF1_MARKER |
static int |
SOF2_MARKER |
static int |
SOF3_MARKER |
static int |
SOF5_MARKER |
static int |
SOF6_MARKER |
static int |
SOF7_MARKER |
static int |
SOF9_MARKER |
static int |
SOFA_MARKER |
static int |
SOFB_MARKER |
static int |
SOFD_MARKER |
static int |
SOFE_MARKER |
static int |
SOFF_MARKER |
static int |
SOI_MARKER
Start of image
|
static int |
SOS_MARKER
Start of scan
|
static int |
TEM_MARKER
Temporary private use in arithmetic coding
|
| Constructor and Description |
|---|
JFIFOutputStream(File imgFile) |
JFIFOutputStream(ImageOutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
finish() |
long |
getSegmentLength()
Returns the length of the current segment or -1 if none has been pushed.
|
long |
getSegmentOffset()
Returns the offset of the current segment or -1 if none has been pushed.
|
long |
getStreamPosition()
Gets the position relative to the beginning of the IFF output stream.
|
void |
popSegment() |
void |
pushSegment(int marker) |
void |
seek(long newPosition)
Seeks relative to the beginning of the IFF output stream.
|
void |
write(byte[] b,
int off,
int len)
Writes stuffed or non-stuffed bytes to the underlying output stream.
|
void |
write(int b)
Writes a stuffed or non-stuffed byte to the underlying output stream.
|
flush, writepublic static final int SOI_MARKER
public static final int EOI_MARKER
public static final int TEM_MARKER
public static final int SOS_MARKER
public static final int APP1_MARKER
public static final int APP2_MARKER
public static final int JPG0_MARKER
public static final int JPG1_MARKER
public static final int JPG2_MARKER
public static final int JPG3_MARKER
public static final int JPG4_MARKER
public static final int JPG5_MARKER
public static final int JPG6_MARKER
public static final int JPG7_MARKER
public static final int JPG8_MARKER
public static final int JPG9_MARKER
public static final int JPGA_MARKER
public static final int JPGB_MARKER
public static final int JPGC_MARKER
public static final int JPGD_MARKER
public static final int SOF0_MARKER
public static final int SOF1_MARKER
public static final int SOF2_MARKER
public static final int SOF3_MARKER
public static final int SOF5_MARKER
public static final int SOF6_MARKER
public static final int SOF7_MARKER
public static final int SOF9_MARKER
public static final int SOFA_MARKER
public static final int SOFB_MARKER
public static final int SOFD_MARKER
public static final int SOFE_MARKER
public static final int SOFF_MARKER
public static final int RST0_MARKER
public static final int RST1_MARKER
public static final int RST2_MARKER
public static final int RST3_MARKER
public static final int RST4_MARKER
public static final int RST5_MARKER
public static final int RST6_MARKER
public static final int RST7_MARKER
public JFIFOutputStream(ImageOutputStream out) throws IOException
IOExceptionpublic JFIFOutputStream(File imgFile) throws IOException
IOExceptionpublic long getStreamPosition()
throws IOException
Usually this value is equal to the stream position of the underlying ImageOutputStream, but can be larger if the underlying stream already contained data.
IOExceptionpublic void seek(long newPosition)
throws IOException
Usually this equal to seeking in the underlying ImageOutputStream, but can be different if the underlying stream already contained data.
IOExceptionpublic void pushSegment(int marker)
throws IOException
IOExceptionpublic void popSegment()
throws IOException
IOExceptionpublic long getSegmentOffset()
throws IOException
IOExceptionpublic long getSegmentLength()
throws IOException
IOExceptionpublic void finish()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionCopyright © 2014. All Rights Reserved.