public class HDF5DataSetRandomAccessFile
extends java.lang.Object
implements ch.systemsx.cisd.base.io.IRandomAccessFile, java.io.Flushable
IRandomAccessFile backed by an HDF5 dataset. The HDF5 dataset needs to be a byte array
(or opaque byte array) of rank 1.| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
flush() |
java.nio.ByteOrder |
getByteOrder()
Gets the byte-order (endiness) of the random access file.
|
java.lang.String |
getDataSetPath() |
long |
getFilePointer()
Returns the current offset in this file.
|
java.io.File |
getHdf5File() |
boolean |
isReadOnly()
Returns
true if the HDF5 file has been opened in read-only mode. |
long |
length()
Returns the length of this file.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
java.lang.String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
java.lang.String |
readUTF() |
void |
reset() |
void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next
read or write occurs.
|
void |
setByteOrder(java.nio.ByteOrder byteOrder)
Sets the byte-order (endiness) of the random access file.
|
void |
setLength(long newLength)
Sets the length of this file.
|
long |
skip(long n) |
int |
skipBytes(int n) |
void |
synchronize()
Performs a synchronization of the resource.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(java.lang.String s) |
void |
writeChar(int v) |
void |
writeChars(java.lang.String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(java.lang.String str) |
public java.io.File getHdf5File()
public java.lang.String getDataSetPath()
public boolean isReadOnly()
true if the HDF5 file has been opened in read-only mode.public long getFilePointer()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
ch.systemsx.cisd.base.io.IRandomAccessFilegetFilePointer in interface ch.systemsx.cisd.base.io.IRandomAccessFilech.systemsx.cisd.base.exceptions.IOExceptionUnchecked - if an I/O error occurs.public int read()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
read in interface ch.systemsx.cisd.base.io.IInputStreamch.systemsx.cisd.base.exceptions.IOExceptionUncheckedInputStream.read()public int read(byte[] b)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
read in interface ch.systemsx.cisd.base.io.IInputStreamch.systemsx.cisd.base.exceptions.IOExceptionUncheckedInputStream.read(byte[])public int read(byte[] b,
int off,
int len)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
read in interface ch.systemsx.cisd.base.io.IInputStreamch.systemsx.cisd.base.exceptions.IOExceptionUncheckedInputStream.read(byte[], int, int)public long skip(long n)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
skip in interface ch.systemsx.cisd.base.io.IInputStreamch.systemsx.cisd.base.exceptions.IOExceptionUncheckedInputStream.skip(long)public int available()
available in interface ch.systemsx.cisd.base.io.IInputStreamInputStream.available()public void close()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
close in interface ch.systemsx.cisd.base.io.IInputStreamclose in interface ch.systemsx.cisd.base.io.IOutputStreamclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablech.systemsx.cisd.base.exceptions.IOExceptionUncheckedInputStream.close()public void mark(int readlimit)
mark in interface ch.systemsx.cisd.base.io.IInputStreamInputStream.mark(int)public void reset()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
reset in interface ch.systemsx.cisd.base.io.IInputStreamch.systemsx.cisd.base.exceptions.IOExceptionUncheckedInputStream.reset()public boolean markSupported()
markSupported in interface ch.systemsx.cisd.base.io.IInputStreamInputStream.markSupported()public void flush()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
flush in interface ch.systemsx.cisd.base.io.IOutputStreamflush in interface java.io.Flushablech.systemsx.cisd.base.exceptions.IOExceptionUncheckedOutputStream.flush()public void synchronize()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
ch.systemsx.cisd.base.io.ISynchronizablesynchronize in interface ch.systemsx.cisd.base.io.IOutputStreamsynchronize in interface ch.systemsx.cisd.base.io.ISynchronizablech.systemsx.cisd.base.exceptions.IOExceptionUncheckedOutputStream.flush()public java.nio.ByteOrder getByteOrder()
ch.systemsx.cisd.base.io.IRandomAccessFilegetByteOrder in interface ch.systemsx.cisd.base.io.IRandomAccessFilepublic void setByteOrder(java.nio.ByteOrder byteOrder)
ch.systemsx.cisd.base.io.IRandomAccessFilesetByteOrder in interface ch.systemsx.cisd.base.io.IRandomAccessFilepublic void seek(long pos)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
ch.systemsx.cisd.base.io.IRandomAccessFileseek in interface ch.systemsx.cisd.base.io.IRandomAccessFilepos - the offset position, measured in bytes from the beginning of the file, at which to
set the file pointer.ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked - if pos is less than 0 or if an I/O
error occurs.public long length()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
ch.systemsx.cisd.base.io.IRandomAccessFilelength in interface ch.systemsx.cisd.base.io.IRandomAccessFilech.systemsx.cisd.base.exceptions.IOExceptionUnchecked - if an I/O error occurs.public void setLength(long newLength)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
ch.systemsx.cisd.base.io.IRandomAccessFile
If the present length of the file as returned by the length method is greater
than the newLength argument then the file will be truncated. In this case, if
the file offset as returned by the getFilePointer method is greater than
newLength then after this method returns the offset will be equal to
newLength.
If the present length of the file as returned by the length method is smaller
than the newLength argument then the file will be extended. In this case, the
contents of the extended portion of the file are not defined.
setLength in interface ch.systemsx.cisd.base.io.IRandomAccessFilenewLength - The desired length of the filech.systemsx.cisd.base.exceptions.IOExceptionUnchecked - If an I/O error occurspublic void readFully(byte[] b)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readFully in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadFully in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readFully(byte[])public void readFully(byte[] b,
int off,
int len)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readFully in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadFully in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readFully(byte[], int, int)public int skipBytes(int n)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
skipBytes in interface ch.systemsx.cisd.base.io.IRandomAccessFileskipBytes in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.skipBytes(int)public boolean readBoolean()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readBoolean in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadBoolean in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readBoolean()public byte readByte()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readByte in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadByte in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readByte()public int readUnsignedByte()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readUnsignedByte in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadUnsignedByte in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readUnsignedByte()public short readShort()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readShort in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadShort in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readShort()public int readUnsignedShort()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readUnsignedShort in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadUnsignedShort in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readUnsignedShort()public char readChar()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readChar in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadChar in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readChar()public int readInt()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readInt in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadInt in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readInt()public long readLong()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readLong in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadLong in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readLong()public float readFloat()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readFloat in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadFloat in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readFloat()public double readDouble()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readDouble in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadDouble in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readDouble()public java.lang.String readLine()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readLine in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadLine in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readLine()public java.lang.String readUTF()
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
readUTF in interface ch.systemsx.cisd.base.io.IRandomAccessFilereadUTF in interface java.io.DataInputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataInput.readUTF()public void write(int b)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
write in interface ch.systemsx.cisd.base.io.IOutputStreamwrite in interface ch.systemsx.cisd.base.io.IRandomAccessFilewrite in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.write(int)public void write(byte[] b)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
write in interface ch.systemsx.cisd.base.io.IOutputStreamwrite in interface ch.systemsx.cisd.base.io.IRandomAccessFilewrite in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.write(byte[])public void write(byte[] b,
int off,
int len)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
write in interface ch.systemsx.cisd.base.io.IOutputStreamwrite in interface ch.systemsx.cisd.base.io.IRandomAccessFilewrite in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.write(byte[], int, int)public void writeBoolean(boolean v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeBoolean in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteBoolean in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeBoolean(boolean)public void writeByte(int v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeByte in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteByte in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeByte(int)public void writeShort(int v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeShort in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteShort in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeShort(int)public void writeChar(int v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeChar in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteChar in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeChar(int)public void writeInt(int v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeInt in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteInt in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeInt(int)public void writeLong(long v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeLong in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteLong in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeLong(long)public void writeFloat(float v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeFloat in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteFloat in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeFloat(float)public void writeDouble(double v)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeDouble in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteDouble in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeDouble(double)public void writeBytes(java.lang.String s)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeBytes in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteBytes in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeBytes(String)public void writeChars(java.lang.String s)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeChars in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteChars in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeChars(String)public void writeUTF(java.lang.String str)
throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
writeUTF in interface ch.systemsx.cisd.base.io.IRandomAccessFilewriteUTF in interface java.io.DataOutputch.systemsx.cisd.base.exceptions.IOExceptionUncheckedDataOutput.writeUTF(String)