Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.iff
Class MC68000OutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by ch.randelshofer.media.iff.MC68000OutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

Deprecated. Use IFFOutputStream instead of this class.

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
          Deprecated. 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)
          Deprecated. Creates a new instance.
 
Method Summary
 void clearCount()
          Deprecated. Sets the value of the counter written to 0.
protected  void incCount(int value)
          Deprecated. Increases the written counter by the specified value until it reaches Long.MAX_VALUE.
 long size()
          Deprecated. 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)
          Deprecated.  
 void write(int b)
          Deprecated.  
 void writeByteRun1(byte[] data)
          Deprecated. ByteRun1 Run Encoding.
 void writeByteRun1(byte[] data, int offset, int length)
          Deprecated.  
 void writeLONG(int v)
          Deprecated.  
 void writeType(java.lang.String s)
          Deprecated. Writes an chunk type identifier (4 bytes).
 void writeUBYTE(int v)
          Deprecated.  
 void writeULONG(long v)
          Deprecated.  
 void writeUWORD(int v)
          Deprecated.  
 void writeWORD(int v)
          Deprecated.  
 
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
Deprecated. 
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)
Deprecated. 
Creates a new instance.

Method Detail

writeLONG

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

writeULONG

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

writeWORD

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

writeUWORD

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

writeUBYTE

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

writeByteRun1

public void writeByteRun1(byte[] data)
                   throws java.io.IOException
Deprecated. 
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
Deprecated. 
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Deprecated. 
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
Deprecated. 
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

writeType

public void writeType(java.lang.String s)
               throws java.io.IOException
Deprecated. 
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()
Deprecated. 
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()
Deprecated. 
Sets the value of the counter written to 0.


incCount

protected void incCount(int value)
Deprecated. 
Increases the written counter by the specified value until it reaches Long.MAX_VALUE.


Copyright 2011-01-06 Werner Randelshofer