public class IFFOutputStream extends OutputStream
Reference:
Commodore-Amiga, Inc. (1991) Amiga ROM Kernel Reference Manual. Devices.
Third Edition. Reading: Addison-Wesley.
| Constructor and Description |
|---|
IFFOutputStream(ImageOutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
finish() |
long |
getStreamPosition()
Gets the position relative to the beginning of the IFF output stream.
|
void |
popChunk() |
void |
pushCompositeChunk(String compositeType,
String chunkType) |
void |
pushDataChunk(String chunkType) |
void |
seek(long newPosition)
Seeks relative to the beginning of the IFF output stream.
|
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) |
flush, writepublic IFFOutputStream(ImageOutputStream out) throws IOException
IOExceptionpublic void pushCompositeChunk(String compositeType, String chunkType) throws IOException
IOExceptionpublic void pushDataChunk(String chunkType) throws IOException
IOExceptionpublic void popChunk()
throws IOException
IOExceptionpublic void finish()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic long getStreamPosition()
throws IOException
Usually this value is equal to the stream position of the underlying ImageOutputStream, but can be larger if the underlying stream already contained data.
IOExceptionpublic void seek(long newPosition)
throws IOException
Usually this equal to seeking in the underlying ImageOutputStream, but can be different if the underlying stream already contained data.
IOExceptionpublic 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 writeTYPE(String s) throws IOException
s - A string with a length of 4 characters.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
IOExceptionCopyright © 2014. All Rights Reserved.