|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer org.w3c.tools.jpeg.JpegCommentWriter
public class JpegCommentWriter
Allow you to write text comments to jpeg stream Some code has been adapted from wrjpgcom.c from The Independent JPEG Group
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
JpegCommentWriter(java.io.OutputStream out,
java.io.InputStream in)
Create a JpegCommentWriter, using an Input stream as the jpeg binary source, and writing in the output stream |
|
JpegCommentWriter(java.io.OutputStream out,
java.io.InputStream in,
java.lang.String enc)
Create a JpegCommentWriter, using an Input stream as the jpeg binary source, and writing in the output stream |
Method Summary | |
---|---|
void |
close()
|
protected void |
dupFirstHeaders()
the the first headers until a SOF parker is found |
protected int |
dupFirstMarker()
copy the marker and return it |
protected void |
dupHeader(int marker)
dup the marker and the body |
void |
flush()
|
java.lang.String |
getEncoding()
gets the encoding used by the comment writer |
static void |
main(java.lang.String[] args)
The usual debugging tool |
protected int |
nextMarker()
get the next marker, and eat extra bytes |
protected int |
read2bytes()
read 2 bytes and create an integer out of it |
protected void |
skipVariable()
skip the body after a marker |
void |
write(char[] buffer)
write an array of characters |
void |
write(char[] buffer,
int off,
int len)
write a portion of an array of characters |
void |
write(int ch)
write one character |
void |
write(java.lang.String s)
Write a String |
void |
write(java.lang.String s,
int off,
int len)
Write a portion of a String |
protected void |
writeMarker(int marker)
|
protected void |
writeMarkerLength(int len)
|
Methods inherited from class java.io.Writer |
---|
append, append, append |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JpegCommentWriter(java.io.OutputStream out, java.io.InputStream in)
out,
- the output stream where the image will be writtenin,
- the input stream of the jpeg file, it MUST point to the
beginning of the jpeg to avoid problemspublic JpegCommentWriter(java.io.OutputStream out, java.io.InputStream in, java.lang.String enc) throws java.io.UnsupportedEncodingException
out,
- the output stream where the image will be writtenin,
- the input stream of the jpeg file, it MUST point to the
beginning of the jpeg to avoid problemsenc,
- the encoding name used when you write comments
java.io.UnsupportedEncodingException
Method Detail |
---|
public java.lang.String getEncoding()
public void write(int ch) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(char[] buffer) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(char[] buffer, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(java.lang.String s) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(java.lang.String s, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Writer
java.io.IOException
protected int dupFirstMarker() throws java.io.IOException, JpegException
java.io.IOException
JpegException
protected int read2bytes() throws java.io.IOException, JpegException
java.io.IOException
JpegException
protected int nextMarker() throws java.io.IOException
java.io.IOException
protected void skipVariable() throws java.io.IOException, JpegException
java.io.IOException
JpegException
protected void dupHeader(int marker) throws java.io.IOException, JpegException
java.io.IOException
JpegException
protected void writeMarker(int marker) throws java.io.IOException
java.io.IOException
protected void writeMarkerLength(int len) throws java.io.IOException
java.io.IOException
protected void dupFirstHeaders() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |