java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.monte.media.iff.MC68000OutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
MC68000OutputStream.
- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longThe number of bytes written to the data output stream so far.Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the value of the counterwrittento 0.protected voidincCount(int value) Increases the written counter by the specified value until it reaches Long.MAX_VALUE.final longsize()Returns the current value of the counterwritten, the number of bytes written to this data output stream so far.voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteByteRun1(byte[] data) ByteRun1 Run Encoding.voidwriteByteRun1(byte[] data, int offset, int length) voidwriteLONG(int v) voidWrites an chunk type identifier (4 bytes).voidwriteUBYTE(int v) voidwriteULONG(long v) voidwriteUWORD(int v) voidwriteWORD(int v) Methods inherited from class java.io.FilterOutputStream
close, flush, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
written
protected long writtenThe number of bytes written to the data output stream so far. If this counter overflows, it will be wrapped to Integer.MAX_VALUE.
-
-
Constructor Details
-
MC68000OutputStream
Creates a new instance.
-
-
Method Details
-
writeLONG
- Throws:
IOException
-
writeULONG
- Throws:
IOException
-
writeWORD
- Throws:
IOException
-
writeUWORD
- Throws:
IOException
-
writeUBYTE
- Throws:
IOException
-
writeByteRun1
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:
IOException
-
writeByteRun1
- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
writeType
Writes an chunk type identifier (4 bytes).- Parameters:
s- A string with a length of 4 characters.- Throws:
IOException
-
size
public final long size()Returns the current value of the counterwritten, 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
writtenfield. - See Also:
-
clearCount
public void clearCount()Sets the value of the counterwrittento 0. -
incCount
protected void incCount(int value) Increases the written counter by the specified value until it reaches Long.MAX_VALUE.
-