public class FileHandle extends AbstractDataHandle<FileLocation>
DataHandle for a FileLocation.| Constructor and Description |
|---|
FileHandle() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
getMode() |
RandomAccessFile |
getRandomAccessFile()
Gets the random access file object backing this FileHandle.
|
Class<FileLocation> |
getType()
Gets the type associated with the object.
|
long |
length()
Returns the length of the stream.
|
long |
offset()
Returns the current offset in the stream.
|
int |
read()
Reads the next byte of data from the stream.
|
int |
read(byte[] b)
Reads up to b.length bytes of data from the stream into an array of bytes.
|
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the stream into an array of bytes.
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
seek(long pos)
Sets the stream pointer offset, measured from the beginning of the stream,
at which the next read or write occurs.
|
void |
setMode(String mode) |
int |
skipBytes(int n) |
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(String s) |
void |
writeChar(int v) |
void |
writeChars(String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(String str) |
findString, findString, findString, findString, getEncoding, getOrder, isLittleEndian, read, read, readCString, readString, readString, setEncoding, setOrder, setOrder, skip, write, writeget, setsupportscompareTo, getInfo, getPriority, setInfo, setPriority, toStringcontext, getContext, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitget, setcontext, getContext, setContextgetPriority, setPrioritycompareTogetInfo, setInfopublic RandomAccessFile getRandomAccessFile() throws IOException
IOExceptionpublic String getMode()
public void setMode(String mode)
public long offset()
throws IOException
DataHandleIOExceptionpublic long length()
throws IOException
DataHandleIOExceptionpublic int read()
throws IOException
DataHandleIOException - - if an I/O error occurs.public int read(byte[] b)
throws IOException
DataHandleread in interface DataHandle<FileLocation>read in class AbstractDataHandle<FileLocation>IOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
DataHandleIOExceptionpublic void seek(long pos)
throws IOException
DataHandleIOExceptionpublic boolean readBoolean()
throws IOException
IOExceptionpublic byte readByte()
throws IOException
IOExceptionpublic char readChar()
throws IOException
IOExceptionpublic double readDouble()
throws IOException
IOExceptionpublic float readFloat()
throws IOException
IOExceptionpublic void readFully(byte[] b)
throws IOException
IOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic int readInt()
throws IOException
IOExceptionpublic String readLine() throws IOException
IOExceptionpublic long readLong()
throws IOException
IOExceptionpublic short readShort()
throws IOException
IOExceptionpublic int readUnsignedByte()
throws IOException
IOExceptionpublic int readUnsignedShort()
throws IOException
IOExceptionpublic String readUTF() throws IOException
IOExceptionpublic int skipBytes(int n)
throws IOException
IOExceptionpublic void write(byte[] b)
throws IOException
IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic void write(int b)
throws IOException
IOExceptionpublic void writeBoolean(boolean v)
throws IOException
IOExceptionpublic void writeByte(int v)
throws IOException
IOExceptionpublic void writeBytes(String s) throws IOException
IOExceptionpublic void writeChar(int v)
throws IOException
IOExceptionpublic void writeChars(String s) throws IOException
IOExceptionpublic void writeDouble(double v)
throws IOException
IOExceptionpublic void writeFloat(float v)
throws IOException
IOExceptionpublic void writeInt(int v)
throws IOException
IOExceptionpublic void writeLong(long v)
throws IOException
IOExceptionpublic void writeShort(int v)
throws IOException
IOExceptionpublic void writeUTF(String str) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic Class<FileLocation> getType()
TypedCopyright © 2009–2016 SciJava. All rights reserved.