Class RIFFPrimitivesInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Reference: AVI RIFF File Reference http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/htm/avirifffilereference.asp
- Author:
- Werner Randelshofer
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidalign()Align to an even byte position in the input stream.longgetScan()Get the current read position within the file (as seen by this input stream filter).voidmark(int readlimit) Marks the input stream.intread()Reads one byte.intread(byte[] b, int offset, int length) Reads a sequence of bytes.intRead 4 bytes from the input stream and interpret them as a four byte character code.Read 4 bytes from the input stream and interpret them as a four byte character code.intreadFully(byte[] b, int offset, int length) Reads a sequence of bytes.intreadLONG()Read 4 bytes from the input stream and interpret them as a 32 Bit signed LONG value.intRead 1 byte from the input stream and interpret them as an 8 Bit unsigned UBYTE value.longRead 4 Bytes from the input Stream and interpret them as an unsigned Integer value of type ULONG.intRead 2 bytes from the input stream and interpret them as a 16 Bit unsigned UWORD value.shortreadWORD()Read 2 bytes from the input stream and interpret them as a 16 Bit signed WORD value.voidreset()Repositions the stream at the previously marked position.longskip(long n) Skips over and discards n bytes of data from this input stream.voidskipFully(long n) Skips over and discards n bytes of data from this input stream.Methods inherited from class java.io.FilterInputStream
available, close, markSupported, readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
RIFFPrimitivesInputStream
Creates a new instance.- Parameters:
in- the input stream.
-
-
Method Details
-
readUBYTE
Read 1 byte from the input stream and interpret them as an 8 Bit unsigned UBYTE value.- Throws:
IOException
-
readWORD
Read 2 bytes from the input stream and interpret them as a 16 Bit signed WORD value.- Throws:
IOException
-
readUWORD
Read 2 bytes from the input stream and interpret them as a 16 Bit unsigned UWORD value.- Throws:
IOException
-
readLONG
Read 4 bytes from the input stream and interpret them as a 32 Bit signed LONG value.- Throws:
IOException
-
readFourCC
Read 4 bytes from the input stream and interpret them as a four byte character code.Cited from Referenced "AVI RIFF File Reference": "A FOURCC (four-character code) is a 32-bit unsigned integer created by concatenating four ASCII characters. For example, the FOURCC 'abcd' is represented on a Little-Endian system as 0x64636261. FOURCCs can contain space characters, so ' abc' is a valid FOURCC. The AVI file format uses FOURCC codes to identify stream types, data chunks, index entries, and other information."
- Throws:
IOException
-
readFourCCString
Read 4 bytes from the input stream and interpret them as a four byte character code.Cited from Referenced "AVI RIFF File Reference": "A FOURCC (four-character code) is a 32-bit unsigned integer created by concatenating four ASCII characters. For example, the FOURCC 'abcd' is represented on a Little-Endian system as 0x64636261. FOURCCs can contain space characters, so ' abc' is a valid FOURCC. The AVI file format uses FOURCC codes to identify stream types, data chunks, index entries, and other information."
- Throws:
IOException
-
readULONG
Read 4 Bytes from the input Stream and interpret them as an unsigned Integer value of type ULONG.- Throws:
IOException
-
align
Align to an even byte position in the input stream. This will skip one byte in the stream if the current read position is not even.- Throws:
IOException
-
getScan
public long getScan()Get the current read position within the file (as seen by this input stream filter). -
read
Reads one byte.- Overrides:
readin classFilterInputStream- Throws:
IOException
-
readFully
Reads a sequence of bytes.- Throws:
IOException
-
read
Reads a sequence of bytes.- Overrides:
readin classFilterInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) Marks the input stream.- Overrides:
markin classFilterInputStream- Parameters:
readlimit- The maximum limit of bytes that can be read before the mark position becomes invalid.
-
reset
Repositions the stream at the previously marked position.- Overrides:
resetin classFilterInputStream- Throws:
IOException- If the stream has not been marked or if the mark has been invalidated.
-
skip
Skips over and discards n bytes of data from this input stream. This skip method tries to skip the provided number of bytes.- Overrides:
skipin classFilterInputStream- Parameters:
n- the number of bytes to be skipped.- Throws:
IOException- if this input stream does not support seek or if some other I/O error occured.
-
skipFully
Skips over and discards n bytes of data from this input stream. Throws- Parameters:
n- the number of bytes to be skipped.- Throws:
EOFException- if this input stream reaches the end before skipping all the bytes.IOException
-