public class BytesHandle extends AbstractDataHandle<BytesLocation>
DataHandle
for a BytesLocation
.DataHandle.ByteOrder
DEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE
Constructor and Description |
---|
BytesHandle() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
exists()
Tests whether this handle's location actually exists at the source.
|
Class<BytesLocation> |
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.
|
long |
length()
Returns the length of the data in bytes.
|
long |
offset()
Returns the current offset in the stream.
|
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from the stream into an array of
bytes. |
byte |
readByte() |
void |
readFully(byte[] b,
int off,
int len) |
void |
seek(long pos)
Sets the stream offset, measured from the beginning of the stream, at which
the next read or write occurs.
|
void |
setLength(long length)
Sets the new length of the handle.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
conversionBuffer, getEncoding, getOrder, setEncoding, setOrder
get, set
supports
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
available, checksum, ensureReadable, ensureWritable, findString, findString, findString, findString, isBigEndian, isLittleEndian, lastModified, read, read, readBoolean, readChar, readCString, readDouble, readFloat, readFully, readInt, readLine, readLong, readShort, readString, readString, readUnsignedByte, readUnsignedShort, readUTF, setLittleEndian, skip, skipBytes, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLine, writeLong, writeShort, writeUTF
get, set
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public boolean isReadable()
DataHandle
public boolean isWritable()
DataHandle
public boolean exists()
DataHandle
public long offset()
DataHandle
public long length()
DataHandle
public void setLength(long length) throws IOException
DataHandle
length
- New length.IOException
- If there is an error changing the handle's length.public int read(byte[] b, int off, int len) throws IOException
DataHandle
len
bytes of data from the stream into an array of
bytes.IOException
public void seek(long pos) throws IOException
DataHandle
IOException
public byte readByte() throws IOException
IOException
public void readFully(byte[] b, int off, int len) throws IOException
IOException
public void write(byte[] b, int off, int len) throws IOException
IOException
public void write(int b) throws IOException
IOException
public void close()
public Class<BytesLocation> getType()
Typed
Copyright © 2015–2022 SciJava. All rights reserved.