java.lang.Object
java.io.OutputStream
org.monte.media.iff.IFFOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Facilitates writing of EA 85 IFF files.
Reference:
Commodore-Amiga, Inc. (1991) Amiga ROM Kernel Reference Manual. Devices.
Third Edition. Reading: Addison-Wesley.
- Author:
- Werner Randelshofer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfinish()longGets the position relative to the beginning of the IFF output stream.voidpopChunk()voidpushCompositeChunk(int compositeType, int chunkType) voidpushCompositeChunk(String compositeType, String chunkType) voidpushDataChunk(int chunkType) voidpushDataChunk(String chunkType) voidseek(long newPosition) Seeks relative to the beginning of the IFF output stream.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.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
IFFOutputStream
- Throws:
IOException
-
-
Method Details
-
pushCompositeChunk
- Throws:
IOException
-
pushCompositeChunk
- Throws:
IOException
-
pushDataChunk
- Throws:
IOException
-
pushDataChunk
- Throws:
IOException
-
popChunk
- Throws:
IOException
-
finish
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
getStreamPosition
Gets the position relative to the beginning of the IFF output stream.Usually this value is equal to the stream position of the underlying ImageOutputStream, but can be larger if the underlying stream already contained data.
- Returns:
- The relative stream position.
- Throws:
IOException
-
seek
Seeks relative to the beginning of the IFF output stream.Usually this equal to seeking in the underlying ImageOutputStream, but can be different if the underlying stream already contained data.
- Throws:
IOException
-
writeLONG
- Throws:
IOException
-
writeULONG
- Throws:
IOException
-
writeWORD
- Throws:
IOException
-
writeUWORD
- Throws:
IOException
-
writeUBYTE
- Throws:
IOException
-
writeTYPE
Writes an chunk type identifier (4 bytes).- Parameters:
s- A string with a length of 4 characters.- 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
-