org.scijava.io
Class FileHandle
java.lang.Object
org.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.plugin.AbstractTypedPlugin<D>
org.scijava.plugin.AbstractWrapperPlugin<L>
org.scijava.io.AbstractDataHandle<FileLocation>
org.scijava.io.FileHandle
- All Implemented Interfaces:
- Closeable, DataInput, DataOutput, Comparable<Prioritized>, Contextual, DataHandle<FileLocation>, HasPluginInfo, RichPlugin, SciJavaPlugin, TypedPlugin<FileLocation>, WrapperPlugin<FileLocation>, Prioritized, Typed<FileLocation>
public class FileHandle
- extends AbstractDataHandle<FileLocation>
DataHandle
for a FileLocation
.
- Author:
- Curtis Rueden
Methods inherited from class org.scijava.io.AbstractDataHandle |
findString, findString, findString, findString, getEncoding, getOrder, isLittleEndian, read, read, readCString, readString, readString, setEncoding, setOrder, setOrder, skip, write, write |
FileHandle
public FileHandle()
getRandomAccessFile
public RandomAccessFile getRandomAccessFile()
throws IOException
- Gets the random access file object backing this FileHandle.
- Throws:
IOException
getMode
public String getMode()
setMode
public void setMode(String mode)
offset
public long offset()
throws IOException
- Description copied from interface:
DataHandle
- Returns the current offset in the stream.
- Throws:
IOException
length
public long length()
throws IOException
- Description copied from interface:
DataHandle
- Returns the length of the stream.
- Throws:
IOException
read
public int read()
throws IOException
- Description copied from interface:
DataHandle
- Reads the next byte of data from the stream.
- Returns:
- the next byte of data, or -1 if the end of the stream is reached.
- Throws:
IOException
- - if an I/O error occurs.
read
public int read(byte[] b)
throws IOException
- Description copied from interface:
DataHandle
- Reads up to b.length bytes of data from the stream into an array of bytes.
- Specified by:
read
in interface DataHandle<FileLocation>
- Overrides:
read
in class AbstractDataHandle<FileLocation>
- Returns:
- the total number of bytes read into the buffer.
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Description copied from interface:
DataHandle
- Reads up to len bytes of data from the stream into an array of bytes.
- Returns:
- the total number of bytes read into the buffer.
- Throws:
IOException
seek
public void seek(long pos)
throws IOException
- Description copied from interface:
DataHandle
- Sets the stream pointer offset, measured from the beginning of the stream,
at which the next read or write occurs.
- Throws:
IOException
readBoolean
public boolean readBoolean()
throws IOException
- Throws:
IOException
readByte
public byte readByte()
throws IOException
- Throws:
IOException
readChar
public char readChar()
throws IOException
- Throws:
IOException
readDouble
public double readDouble()
throws IOException
- Throws:
IOException
readFloat
public float readFloat()
throws IOException
- Throws:
IOException
readFully
public void readFully(byte[] b)
throws IOException
- Throws:
IOException
readFully
public void readFully(byte[] b,
int off,
int len)
throws IOException
- Throws:
IOException
readInt
public int readInt()
throws IOException
- Throws:
IOException
readLine
public String readLine()
throws IOException
- Throws:
IOException
readLong
public long readLong()
throws IOException
- Throws:
IOException
readShort
public short readShort()
throws IOException
- Throws:
IOException
readUnsignedByte
public int readUnsignedByte()
throws IOException
- Throws:
IOException
readUnsignedShort
public int readUnsignedShort()
throws IOException
- Throws:
IOException
readUTF
public String readUTF()
throws IOException
- Throws:
IOException
skipBytes
public int skipBytes(int n)
throws IOException
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Throws:
IOException
write
public void write(int b)
throws IOException
- Throws:
IOException
writeBoolean
public void writeBoolean(boolean v)
throws IOException
- Throws:
IOException
writeByte
public void writeByte(int v)
throws IOException
- Throws:
IOException
writeBytes
public void writeBytes(String s)
throws IOException
- Throws:
IOException
writeChar
public void writeChar(int v)
throws IOException
- Throws:
IOException
writeChars
public void writeChars(String s)
throws IOException
- Throws:
IOException
writeDouble
public void writeDouble(double v)
throws IOException
- Throws:
IOException
writeFloat
public void writeFloat(float v)
throws IOException
- Throws:
IOException
writeInt
public void writeInt(int v)
throws IOException
- Throws:
IOException
writeLong
public void writeLong(long v)
throws IOException
- Throws:
IOException
writeShort
public void writeShort(int v)
throws IOException
- Throws:
IOException
writeUTF
public void writeUTF(String str)
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Throws:
IOException
getType
public Class<FileLocation> getType()
- Description copied from interface:
Typed
- Gets the type associated with the object.
Copyright © 2009–2015 SciJava. All rights reserved.