java.io.DataInputpublic class RandomAccessFileOrArray
extends java.lang.Object
implements java.io.DataInput
| Constructor | Description |
|---|---|
RandomAccessFileOrArray(byte[] arrayIn) |
Deprecated.
|
RandomAccessFileOrArray(RandomAccessSource byteSource) |
Creates a RandomAccessFileOrArray that wraps the specified byte source.
|
RandomAccessFileOrArray(RandomAccessFileOrArray source) |
Deprecated.
use
createView() instead |
RandomAccessFileOrArray(java.io.InputStream is) |
Deprecated.
|
RandomAccessFileOrArray(java.lang.String filename) |
Deprecated.
use
RandomAccessFileOrArray(RandomAccessSource) instead |
RandomAccessFileOrArray(java.lang.String filename,
boolean forceRead,
boolean plainRandomAccess) |
Deprecated.
|
RandomAccessFileOrArray(java.net.URL url) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
RandomAccessSource |
createSourceView() |
|
RandomAccessFileOrArray |
createView() |
Creates an independent view of this object (with it's own file pointer and pushback queue).
|
protected RandomAccessSource |
getByteSource() |
Deprecated.
|
long |
getFilePointer() |
|
long |
length() |
|
void |
pushBack(byte b) |
Pushes a byte back.
|
int |
read() |
Reads a single byte
|
int |
read(byte[] b) |
|
int |
read(byte[] b,
int off,
int len) |
|
boolean |
readBoolean() |
|
byte |
readByte() |
|
char |
readChar() |
|
char |
readCharLE() |
Reads a Unicode character from this stream in little-endian order.
|
double |
readDouble() |
|
double |
readDoubleLE() |
|
float |
readFloat() |
|
float |
readFloatLE() |
|
void |
readFully(byte[] b) |
|
void |
readFully(byte[] b,
int off,
int len) |
|
int |
readInt() |
|
int |
readIntLE() |
Reads a signed 32-bit integer from this stream in little-endian order.
|
java.lang.String |
readLine() |
|
long |
readLong() |
|
long |
readLongLE() |
|
short |
readShort() |
|
short |
readShortLE() |
Reads a signed 16-bit number from this stream in little-endian order.
|
java.lang.String |
readString(int length,
java.lang.String encoding) |
Reads a
String from the font file as bytes using the given
encoding. |
int |
readUnsignedByte() |
|
long |
readUnsignedInt() |
Reads an unsigned 32-bit integer from this stream.
|
long |
readUnsignedIntLE() |
|
int |
readUnsignedShort() |
|
int |
readUnsignedShortLE() |
Reads an unsigned 16-bit number from this stream in little-endian order.
|
java.lang.String |
readUTF() |
|
void |
reOpen() |
Deprecated.
|
void |
seek(long pos) |
|
long |
skip(long n) |
|
int |
skipBytes(int n) |
@Deprecated
public RandomAccessFileOrArray(java.lang.String filename)
throws java.io.IOException
RandomAccessFileOrArray(RandomAccessSource) insteadfilename - java.io.IOException@Deprecated public RandomAccessFileOrArray(RandomAccessFileOrArray source)
createView() insteadsource - the source for the new independent viewpublic RandomAccessFileOrArray(RandomAccessSource byteSource)
byteSource - the byte source to wrap@Deprecated
public RandomAccessFileOrArray(java.lang.String filename,
boolean forceRead,
boolean plainRandomAccess)
throws java.io.IOException
filename - the file to open (can be a file system file or one of the following url strings: file://, http://, https://, jar:, wsjar:, vfszip:forceRead - if true, the entire file will be read into memoryplainRandomAccess - if true, a regular RandomAccessFile is used to access the file contents. If false, a memory mapped file will be used, unless the file cannot be mapped into memory, in which case regular RandomAccessFile will be usedjava.io.IOException - if there is a failure opening or reading the file@Deprecated
public RandomAccessFileOrArray(java.net.URL url)
throws java.io.IOException
url - java.io.IOException@Deprecated
public RandomAccessFileOrArray(java.io.InputStream is)
throws java.io.IOException
is - java.io.IOException@Deprecated public RandomAccessFileOrArray(byte[] arrayIn)
arrayIn - byte[]java.io.IOExceptionpublic RandomAccessFileOrArray createView()
public RandomAccessSource createSourceView()
@Deprecated protected RandomAccessSource getByteSource()
public void pushBack(byte b)
b - the byte to pushpublic int read()
throws java.io.IOException
java.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
java.io.IOExceptionpublic void readFully(byte[] b)
throws java.io.IOException
readFully in interface java.io.DataInputjava.io.IOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws java.io.IOException
readFully in interface java.io.DataInputjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
java.io.IOExceptionpublic int skipBytes(int n)
throws java.io.IOException
skipBytes in interface java.io.DataInputjava.io.IOException@Deprecated
public void reOpen()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic long length()
throws java.io.IOException
java.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
java.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
java.io.IOExceptionpublic boolean readBoolean()
throws java.io.IOException
readBoolean in interface java.io.DataInputjava.io.IOExceptionpublic byte readByte()
throws java.io.IOException
readByte in interface java.io.DataInputjava.io.IOExceptionpublic int readUnsignedByte()
throws java.io.IOException
readUnsignedByte in interface java.io.DataInputjava.io.IOExceptionpublic short readShort()
throws java.io.IOException
readShort in interface java.io.DataInputjava.io.IOExceptionpublic final short readShortLE()
throws java.io.IOException
b1 and b2, where each of the two values is
between 0 and 255, inclusive, then the
result is equal to:
(short)((b2 << 8) | b1)
This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
java.io.EOFException - if this stream reaches the end before reading
two bytes.java.io.IOException - if an I/O error occurs.public int readUnsignedShort()
throws java.io.IOException
readUnsignedShort in interface java.io.DataInputjava.io.IOExceptionpublic final int readUnsignedShortLE()
throws java.io.IOException
b1 and b2, where
0 <= b1, b2 <= 255,
then the result is equal to:
(b2 << 8) | b1
This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
java.io.EOFException - if this stream reaches the end before reading
two bytes.java.io.IOException - if an I/O error occurs.public char readChar()
throws java.io.IOException
readChar in interface java.io.DataInputjava.io.IOExceptionpublic final char readCharLE()
throws java.io.IOException
b1 and b2, where
0 <= b1, b2 <= 255,
then the result is equal to:
(char)((b2 << 8) | b1)
This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
java.io.EOFException - if this stream reaches the end before reading
two bytes.java.io.IOException - if an I/O error occurs.public int readInt()
throws java.io.IOException
readInt in interface java.io.DataInputjava.io.IOExceptionpublic final int readIntLE()
throws java.io.IOException
b1,
b2, b3, and b4, where
0 <= b1, b2, b3, b4 <= 255,
then the result is equal to:
(b4 << 24) | (b3 << 16) + (b2 << 8) + b1
This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.
int.java.io.EOFException - if this stream reaches the end before reading
four bytes.java.io.IOException - if an I/O error occurs.public final long readUnsignedInt()
throws java.io.IOException
b1,
b2, b3, and b4, where
0 <= b1, b2, b3, b4 <= 255,
then the result is equal to:
(b1 << 24) | (b2 << 16) + (b3 << 8) + b4
This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.
long.java.io.EOFException - if this stream reaches the end before reading
four bytes.java.io.IOException - if an I/O error occurs.public final long readUnsignedIntLE()
throws java.io.IOException
java.io.IOExceptionpublic long readLong()
throws java.io.IOException
readLong in interface java.io.DataInputjava.io.IOExceptionpublic final long readLongLE()
throws java.io.IOException
java.io.IOExceptionpublic float readFloat()
throws java.io.IOException
readFloat in interface java.io.DataInputjava.io.IOExceptionpublic final float readFloatLE()
throws java.io.IOException
java.io.IOExceptionpublic double readDouble()
throws java.io.IOException
readDouble in interface java.io.DataInputjava.io.IOExceptionpublic final double readDoubleLE()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readLine()
throws java.io.IOException
readLine in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String readUTF()
throws java.io.IOException
readUTF in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String readString(int length,
java.lang.String encoding)
throws java.io.IOException
String from the font file as bytes using the given
encoding.length - the length of bytes to readencoding - the given encodingString readjava.io.IOException - the font file could not be readCopyright © 1998–2018. All rights reserved.