|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.common.io.AbstractRandomAccessInput
public abstract class AbstractRandomAccessInput
Abstract superclass for RandomAccessInput
implementations.
Constructor Summary | |
---|---|
AbstractRandomAccessInput()
|
Method Summary | |
---|---|
static RandomAccessInput |
createRandomAccessInput(DataSource dataSource)
Factory method that creates an instance of the best RandomAccessInput implementation for a given byte
array. |
static RandomAccessInput |
createRandomAccessInput(String description,
byte[] byteArray)
Factory method that creates an instance of the best RandomAccessInput implementation for a given byte
array. |
static RandomAccessInput |
createRandomAccessInput(URL url)
Factory method that creates an instance of the best RandomAccessInput implementation for a given URL. |
BigDecimal |
readFixed16x16Signed()
Reads a fixed-length decimal number with a 16-bit signed twos-complement mantissa, followed by a 16-bit unsigned fraction. |
String |
readNullTerminatedString(Charset characterSet)
Reads a null-terminated String. |
int |
readShortLoHi()
Read a signed 2-byte short in little-endian order, that is, making the first byte the low-order byte and the second byte the high-order byte. |
String |
readString(int stringSize,
Charset characterSet)
Reads a String of stringSize bytes at the current location. |
String |
readStringASCII(int stringSize)
Reads an ASCII String of stringSize bytes at the current location. |
String |
readTerminatedString(byte terminatingChar,
Charset characterSet)
Reads a string terminated by a specific character, usually the null character, 0x00. |
long |
readUnsignedInt()
Read 4 unsigned bytes and convert them to a long containing the unsigned value. |
long |
readUnsignedIntLoHi()
Read an unsigned 4-byte integer, and reverse the byte order, making the lowest-order byte first and the highest-order byte last. |
int |
readUnsignedShortLoHi()
Read an unsigned 2-byte short, and reverse the byte order, making the low-order byte first and the high-order byte last. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.foray.common.io.RandomAccessInput |
---|
getDescription, getInputStream, getOffset, length, seek |
Methods inherited from interface java.io.DataInput |
---|
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes |
Constructor Detail |
---|
public AbstractRandomAccessInput()
Method Detail |
---|
public static RandomAccessInput createRandomAccessInput(URL url) throws IOException
RandomAccessInput
implementation for a given URL.
url
- The URL for which a RandomAccessInput
instance is needed.
RandomAccessInput
instance.
IOException
- For errors opening or reading the URL.public static RandomAccessInput createRandomAccessInput(String description, byte[] byteArray)
RandomAccessInput
implementation for a given byte
array.
description
- The description of the byte array.byteArray
- The byte array for which a RandomAccessInput
instance
is needed.
RandomAccessInput
instance.public static RandomAccessInput createRandomAccessInput(DataSource dataSource) throws IOException
RandomAccessInput
implementation for a given byte
array.
dataSource
- The data source containing the description and content.
RandomAccessInput
instance.
IOException
- For errors opening or reading the input stream.public final long readUnsignedInt() throws IOException
RandomAccessInput
readUnsignedInt
in interface RandomAccessInput
IOException
- For I/O error.public long readUnsignedIntLoHi() throws IOException
RandomAccessInput
readUnsignedIntLoHi
in interface RandomAccessInput
IOException
- For I/O error.public int readUnsignedShortLoHi() throws IOException
RandomAccessInput
readUnsignedShortLoHi
in interface RandomAccessInput
IOException
- For I/O error.public int readShortLoHi() throws IOException
RandomAccessInput
readShortLoHi
in interface RandomAccessInput
IOException
- For I/O error.public String readString(int stringSize, Charset characterSet) throws IOException
RandomAccessInput
readString
in interface RandomAccessInput
stringSize
- The length, in bytes, of the String to be read.characterSet
- The encoding scheme to be used for interpreting the characters in the string.
IOException
- For reading past the end of the input.public String readStringASCII(int stringSize) throws IOException
RandomAccessInput
readStringASCII
in interface RandomAccessInput
stringSize
- The length, in bytes, of the String to be read.
IOException
- For reading past the end of the input.public String readTerminatedString(byte terminatingChar, Charset characterSet) throws IOException
RandomAccessInput
readTerminatedString
in interface RandomAccessInput
terminatingChar
- The value to be used as the terminator for the read String.characterSet
- The encoding scheme to be used for interpreting the characters in the string.
IOException
- For I/O error.public String readNullTerminatedString(Charset characterSet) throws IOException
RandomAccessInput
readNullTerminatedString
in interface RandomAccessInput
characterSet
- The encoding scheme to be used for interpreting the characters in the string.
IOException
- For I/O error.public BigDecimal readFixed16x16Signed() throws IOException
RandomAccessInput
readFixed16x16Signed
in interface RandomAccessInput
IOException
- For I/O Error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |