|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.squawk.util.StructuredFileInputStream
public abstract class StructuredFileInputStream
An instance of StructuredInputStream
is used to read a file that
must conform to some given format such as a class file or a suite file.
Constructor Summary | |
---|---|
StructuredFileInputStream(InputStream in,
String filePath,
String traceFeature)
Creates a StructuredFileInputStream that reads class components
from a given input stream. |
Method Summary | |
---|---|
void |
close()
Closes this reader and releases any system resources associated with the underlying input stream. |
abstract Error |
formatError(String msg)
Throw a LinkageError to indicate there was an IO error or the file did not conform to the structure expected by the client of this class. |
int |
getBytesRead()
Gets the number of bytes that have been read so far. |
String |
getFileName()
Gets the name of the file from which this reader is reading. |
int |
readByte(String prefix)
Reads a signed byte from the file. |
double |
readDouble(String prefix)
Reads a double value from the file. |
void |
readEOF()
Ensures that the input stream is at the end of the file. |
float |
readFloat(String prefix)
Reads a float value from the file. |
void |
readFully(byte[] b,
String prefix)
Reads some bytes from the class file and stores them into the buffer array b . |
int |
readInt(String prefix)
Reads an integer from the class file. |
long |
readLong(String prefix)
Reads a long value from the file. |
int |
readShort(String prefix)
Reads a signed short from the file. |
int |
readUnsignedByte(String prefix)
Reads an unsigned byte from the file. |
int |
readUnsignedShort(String prefix)
Reads an unsigned short from the class file. |
String |
readUTF(String prefix)
Reads a UTF-8 encoded string from the file. |
void |
skip(int n,
String prefix)
Skips over and discards n bytes of data from the file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StructuredFileInputStream(InputStream in, String filePath, String traceFeature)
StructuredFileInputStream
that reads class components
from a given input stream.
in
- the input streamfilePath
- the file from which in
was createdtraceFeature
- the tracing feature that must be enabled if tracing is to be enabledMethod Detail |
---|
public final String getFileName()
public abstract Error formatError(String msg)
msg
- the cause of the error
public final int getBytesRead()
readInt(java.lang.String)
failed with an IOException, any bytes read during
the call will not be included in the total.
public final void readFully(byte[] b, String prefix)
b
. The number of bytes read is equal to the
length of b
.
b
- the buffer to fillprefix
- the optional prefix used when tracing this readpublic final int readInt(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readInt()
public final int readUnsignedShort(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readUnsignedShort()
public final int readUnsignedByte(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readUnsignedByte()
public final int readShort(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readShort()
public final int readByte(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readByte()
public final long readLong(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readLong()
public final float readFloat(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readFloat()
public final double readDouble(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readDouble()
public final String readUTF(String prefix)
prefix
- the optional prefix used when tracing this read
DataInputStream.readUTF()
public final void skip(int n, String prefix)
n
bytes of data from the file.
n
- the number of bytes to be skipped.prefix
- the optional prefix used when tracing this readpublic void readEOF()
a
- LinkageError if the input stream is not at the end of the filepublic final void close()
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |