|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream java.io.DataInputStream hep.io.xdr.XDRInputStream
A class for reading XDR files. Not too hard to do in Java since the XDR format is very similar to the Java native DataStream format, except for String and the fact that elements (ro an array of elements) are always padded to a multiple of 4 bytes. This class requires the user to call the pad method, to skip to the next 4-byte boundary after reading an element or array of elements that may not span a multiple of 4 bytes.
Field Summary |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
XDRInputStream(InputStream in)
|
Method Summary | |
void |
clearReadLimit()
|
long |
getBytesRead()
|
void |
pad()
Skips appropriate amount to bring stream to 4-byte boundary. |
double[] |
readDoubleArray(double[] buffer)
Reads a double array. |
float[] |
readFloatArray(float[] buffer)
Reads a float array. |
int[] |
readIntArray(int[] buffer)
Reads an integer array. |
String |
readString()
Read a String. |
String |
readString(int l)
Reads a String of length l bytes, and skips appropriate amount to bring stream to 4-byte boundary. |
void |
setReadLimit(int bytes)
Sets a limit on the number of bytes that can be read from this file before an EOF will be generated |
Methods inherited from class java.io.DataInputStream |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes |
Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 XDRInputStream(InputStream in)
Method Detail |
public long getBytesRead()
public void setReadLimit(int bytes)
public void clearReadLimit()
public void pad() throws IOException
pad
in interface XDRDataInput
IOException
public double[] readDoubleArray(double[] buffer) throws IOException
XDRDataInput
readDoubleArray
in interface XDRDataInput
IOException
public float[] readFloatArray(float[] buffer) throws IOException
XDRDataInput
readFloatArray
in interface XDRDataInput
IOException
public int[] readIntArray(int[] buffer) throws IOException
XDRDataInput
readIntArray
in interface XDRDataInput
IOException
public String readString(int l) throws IOException
XDRDataInput
readString
in interface XDRDataInput
IOException
public String readString() throws IOException
XDRDataInput
readString
in interface XDRDataInput
IOException
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |