public class JFIFOutputStream
extends java.io.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(java.io.File imgFile) |
JFIFOutputStream(javax.imageio.stream.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.
|
public 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(javax.imageio.stream.ImageOutputStream out) throws java.io.IOException
java.io.IOException
public JFIFOutputStream(java.io.File imgFile) throws java.io.IOException
java.io.IOException
public long getStreamPosition() throws java.io.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.
java.io.IOException
public void seek(long newPosition) throws java.io.IOException
Usually this equal to seeking in the underlying ImageOutputStream, but can be different if the underlying stream already contained data.
java.io.IOException
public void pushSegment(int marker) throws java.io.IOException
java.io.IOException
public void popSegment() throws java.io.IOException
java.io.IOException
public long getSegmentOffset() throws java.io.IOException
java.io.IOException
public long getSegmentLength() throws java.io.IOException
java.io.IOException
public void finish() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException