Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.w3c.tools.jpeg
Class JpegCommentWriter

    java.lang.Object
      |
      +--java.io.Writer
            |
            +--org.w3c.tools.jpeg.JpegCommentWriter

public class JpegCommentWriter
extends java.io.Writer

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.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JpegCommentWriter

    public 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

    public JpegCommentWriter(java.io.OutputStream out,
                             java.io.InputStream in,
                             java.lang.String enc)
                      throws java.io.UnsupportedEncodingException

  Create a JpegCommentWriter, using an Input stream as the jpeg binary source, and writing in the output stream

Method Detail

### getEncoding

    public java.lang.String getEncoding()

  gets the encoding used by the comment writer

### write

    public void write(int ch)
               throws java.io.IOException

  write one character

  Overrides:
    `write` in class `java.io.Writer`
    `java.io.IOException`

### write

    public void write(char[] buffer)
               throws java.io.IOException

  write an array of characters

  Overrides:
    `write` in class `java.io.Writer`
    `java.io.IOException`

### write

    public void write(char[] buffer,
                      int off,
                      int len)
               throws java.io.IOException

  write a portion of an array of characters

  Specified by:
    `write` in class `java.io.Writer`
    `java.io.IOException`

### write

    public void write(java.lang.String s)
               throws java.io.IOException

  Write a String

  Overrides:
    `write` in class `java.io.Writer`
    `java.io.IOException`

### write

    public void write(java.lang.String s,
                      int off,
                      int len)
               throws java.io.IOException

  Write a portion of a String

  Overrides:
    `write` in class `java.io.Writer`
    `java.io.IOException`

### flush

    public void flush()
               throws java.io.IOException

  Specified by:
    `flush` in class `java.io.Writer`
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Specified by:
    `close` in class `java.io.Writer`
    `java.io.IOException`

### dupFirstMarker

    protected int dupFirstMarker()
                          throws java.io.IOException,
                                 JpegException

  copy the marker and return it

    `java.io.IOException`
    `JpegException`

### read2bytes

    protected int read2bytes()
                      throws java.io.IOException,
                             JpegException

  read 2 bytes and create an integer out of it

    `java.io.IOException`
    `JpegException`

### nextMarker

    protected int nextMarker()
                      throws java.io.IOException

  get the next marker, and eat extra bytes

    `java.io.IOException`

### skipVariable

    protected void skipVariable()
                         throws java.io.IOException,
                                JpegException

  skip the body after a marker

    `java.io.IOException`
    `JpegException`

### dupHeader

    protected void dupHeader(int marker)
                      throws java.io.IOException,
                             JpegException

  dup the marker and the body

    `java.io.IOException`
    `JpegException`

### writeMarker

    protected void writeMarker(int marker)
                        throws java.io.IOException

    `java.io.IOException`

### writeMarkerLength

    protected void writeMarkerLength(int len)
                              throws java.io.IOException

    `java.io.IOException`

### dupFirstHeaders

    protected void dupFirstHeaders()
                            throws java.io.IOException

  the the first headers until a SOF parker is found

    `java.io.IOException`

### main

    public static void main(java.lang.String[] args)

  The usual debugging tool

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD