Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media.iff
Class MC68000OutputStream

    java.lang.Object
      java.io.OutputStream
          java.io.FilterOutputStream
              org.monte.media.iff.MC68000OutputStream

All Implemented Interfaces:
  java.io.Closeable, java.io.Flushable

    public class MC68000OutputStream

extends java.io.FilterOutputStream

MC68000OutputStream.

Version:
  1.1 2010-12-26 Added method writeType().
  1.0.1 2008-08-03 The ByteRun1 encoder incorrectly added 1 to its index when flushing the literal run.
  1.0 December 25, 2006 Created.
Author:
  Werner Randelshofer

Field Summary
`protected long` | `written` The number of bytes written to the data output stream so far.

Fields inherited from class java.io.FilterOutputStream
`out`

Constructor Summary
`MC68000OutputStream(java.io.OutputStream out)` Creates a new instance.

Method Summary
`void` | `clearCount()` Sets the value of the counter `written` to 0.
`protected void` | `incCount(int value)` Increases the written counter by the specified value until it reaches Long.MAX_VALUE.
`long` | `size()` Returns the current value of the counter `written`, the number of bytes written to this data output stream so far.
`void` | `write(byte[] b, int off, int len)`
`void` | `write(int b)`
`void` | `writeByteRun1(byte[] data)` ByteRun1 Run Encoding.
`void` | `writeByteRun1(byte[] data, int offset, int length)`
`void` | `writeLONG(int v)`
`void` | `writeType(java.lang.String s)` Writes an chunk type identifier (4 bytes).
`void` | `writeUBYTE(int v)`
`void` | `writeULONG(long v)`
`void` | `writeUWORD(int v)`
`void` | `writeWORD(int v)`

Methods inherited from class java.io.FilterOutputStream
`close, flush, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### written

    protected long written

  The number of bytes written to the data output stream so far. If this counter overflows, it will be wrapped to Integer.MAX_VALUE.

Constructor Detail

### MC68000OutputStream

    public MC68000OutputStream(java.io.OutputStream out)

  Creates a new instance.

Method Detail

### writeLONG

    public void writeLONG(int v)
                   throws java.io.IOException

  Throws:
    `java.io.IOException`

### writeULONG

    public void writeULONG(long v)
                    throws java.io.IOException

  Throws:
    `java.io.IOException`

### writeWORD

    public void writeWORD(int v)
                   throws java.io.IOException

  Throws:
    `java.io.IOException`

### writeUWORD

    public void writeUWORD(int v)
                    throws java.io.IOException

  Throws:
    `java.io.IOException`

### writeUBYTE

    public void writeUBYTE(int v)
                    throws java.io.IOException

  Throws:
    `java.io.IOException`

### writeByteRun1

    public void writeByteRun1(byte[] data)
                       throws java.io.IOException

  ByteRun1 Run Encoding.

  The run encoding scheme in byteRun1 is best described by pseudo code for the decoder Unpacker (called UnPackBits in the Macintosh toolbox):

       UnPacker:
          LOOP until produced the desired number of bytes
             Read the next source byte into n
             SELECT n FROM
                [ 0..127 ] => copy the next n+1 bytes literally
                [-1..-127] => replicate the next byte -n+1 timees
                -128       => no operation
             ENDCASE
          ENDLOOP

  Throws:
    `java.io.IOException`

### writeByteRun1

    public void writeByteRun1(byte[] data,
                              int offset,
                              int length)
                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### write

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

  Overrides:
    `write` in class `java.io.FilterOutputStream`
  Throws:
    `java.io.IOException`

### write

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

  Overrides:
    `write` in class `java.io.FilterOutputStream`
  Throws:
    `java.io.IOException`

### writeType

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

  Writes an chunk type identifier (4 bytes).

  Parameters:
    `s` - A string with a length of 4 characters.
  Throws:
    `java.io.IOException`

### size

    public final long size()

  Returns the current value of the counter `written`, the number of bytes written to this data output stream so far. If the counter overflows, it will be wrapped to Integer.MAX_VALUE.

  Returns:
    the value of the `written` field.
  See Also:
    `DataOutputStream.written`

### clearCount

    public void clearCount()

  Sets the value of the counter `written` to 0.

### incCount

    protected void incCount(int value)

  Increases the written counter by the specified value until it reaches Long.MAX_VALUE.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD