public class MC68000OutputStream extends FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected long |
written
The number of bytes written to the data output stream so far.
|
out| Constructor and Description |
|---|
MC68000OutputStream(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(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) |
close, flush, writeprotected long written
public MC68000OutputStream(OutputStream out)
public void writeLONG(int v)
throws IOException
IOExceptionpublic void writeULONG(long v)
throws IOException
IOExceptionpublic void writeWORD(int v)
throws IOException
IOExceptionpublic void writeUWORD(int v)
throws IOException
IOExceptionpublic void writeUBYTE(int v)
throws IOException
IOExceptionpublic void writeByteRun1(byte[] data)
throws 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
IOExceptionpublic void writeByteRun1(byte[] data,
int offset,
int length)
throws IOException
IOExceptionpublic void write(int b)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void writeType(String s) throws IOException
s - A string with a length of 4 characters.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)
Copyright © 2014. All Rights Reserved.