public class MC68000OutputStream
extends java.io.FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected long |
written
The number of bytes written to the data output stream so far.
|
| Constructor and Description |
|---|
MC68000OutputStream(java.io.OutputStream out)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
protected long written
public MC68000OutputStream(java.io.OutputStream out)
public void writeLONG(int v)
throws java.io.IOException
java.io.IOExceptionpublic void writeULONG(long v)
throws java.io.IOException
java.io.IOExceptionpublic void writeWORD(int v)
throws java.io.IOException
java.io.IOExceptionpublic void writeUWORD(int v)
throws java.io.IOException
java.io.IOExceptionpublic void writeUBYTE(int v)
throws java.io.IOException
java.io.IOExceptionpublic void writeByteRun1(byte[] data)
throws java.io.IOException
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
java.io.IOExceptionpublic void writeByteRun1(byte[] data,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void writeType(java.lang.String s)
throws java.io.IOException
s - A string with a length of 4 characters.java.io.IOExceptionpublic final long size()
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.written field.DataOutputStream.writtenpublic void clearCount()
written to 0.protected void incCount(int value)