public class FileHandle extends AbstractDataHandle<FileLocation>
DataHandle for a FileLocation.DataHandle.ByteOrderDEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE| Constructor and Description |
|---|
FileHandle() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
exists()
Tests whether this handle's location actually exists at the source.
|
String |
getMode() |
RandomAccessFile |
getRandomAccessFile()
Gets the random access file object backing this FileHandle.
|
Class<FileLocation> |
getType()
Gets the type associated with the object.
|
boolean |
isReadable()
Gets whether reading from this handle is supported.
|
boolean |
isWritable()
Gets whether writing to this handle is supported.
|
Date |
lastModified()
Gets the last modified timestamp of the location.
|
long |
length()
Returns the length of the data in bytes.
|
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() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
String |
readLine() |
int |
readUnsignedByte() |
String |
readUTF() |
void |
seek(long pos)
Sets the stream offset, measured from the beginning of the stream, at which
the next read or write occurs.
|
void |
set(FileLocation loc)
Associates the given data object with this plugin.
|
void |
setLength(long length)
Sets the new length of the handle.
|
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 |
writeChars(String s) |
void |
writeUTF(String str) |
conversionBuffer, getEncoding, getOrder, setEncoding, setOrdergetsupportsgetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitavailable, checksum, ensureReadable, ensureWritable, findString, findString, findString, findString, isBigEndian, isLittleEndian, readChar, readCString, readDouble, readFloat, readInt, readLong, readShort, readString, readString, readUnsignedShort, setLittleEndian, skip, writeChar, writeDouble, writeFloat, writeInt, writeLine, writeLong, writeShortgetgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersionpublic RandomAccessFile getRandomAccessFile() throws IOException
IOExceptionpublic String getMode()
public void setMode(String mode)
public boolean isReadable()
DataHandlepublic boolean isWritable()
DataHandlepublic boolean exists()
DataHandlepublic Date lastModified()
DataHandlepublic long offset()
throws IOException
DataHandleIOExceptionpublic long length()
throws IOException
DataHandleIOExceptionpublic void setLength(long length)
throws IOException
DataHandlelength - New length.IOException - If there is an error changing the handle's length.public int read()
throws IOException
DataHandleIOException - - if an I/O error occurs.public int read(byte[] b)
throws IOException
DataHandleIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
DataHandlelen bytes of data from the stream into an array of
bytes.IOExceptionpublic void seek(long pos)
throws IOException
DataHandleIOExceptionpublic boolean readBoolean()
throws IOException
IOExceptionpublic byte readByte()
throws IOException
IOExceptionpublic void readFully(byte[] b)
throws IOException
IOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic String readLine() throws IOException
IOExceptionpublic int readUnsignedByte()
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 writeChars(String s) throws IOException
IOExceptionpublic void writeUTF(String str) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void set(FileLocation loc)
WrapperPluginTyped.supports(T) must return true).set in interface WrapperPlugin<FileLocation>set in class AbstractWrapperPlugin<FileLocation>loc - The data object to associate with the plugin.public Class<FileLocation> getType()
TypedCopyright © 2015–2022 SciJava. All rights reserved.