public class MultiWriteHandle extends AbstractDataHandle<Location>
DataHandle plugin for writing to multiple DataHandles.DataHandle.ByteOrderDEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE| Constructor and Description |
|---|
MultiWriteHandle(DataHandle<?>... handles) |
| Modifier and Type | Method and Description |
|---|---|
String |
checksum()
Gets a "fast" checksum which succinctly represents the contents of the data
stream.
|
void |
close() |
boolean |
exists()
Tests whether this handle's location actually exists at the source.
|
Class<Location> |
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(byte[] b,
int off,
int len)
Reads up to
len bytes of data from the stream into an array of
bytes. |
byte |
readByte() |
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, setOrderget, setsupportsgetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitavailable, ensureReadable, ensureWritable, findString, findString, findString, findString, isBigEndian, isLittleEndian, read, read, readBoolean, readChar, readCString, readDouble, readFloat, readFully, 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, writeUTFget, setgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersionpublic MultiWriteHandle(DataHandle<?>... handles)
public boolean isReadable()
DataHandlepublic boolean isWritable()
DataHandlepublic boolean exists()
throws IOException
DataHandleIOException - If something goes wrong with the existence check.public Date lastModified() throws IOException
DataHandleIOException - If something goes wrong with the last modified check.public String checksum() throws IOException
DataHandleNo guarantee is made about the exact nature of the checksum (e.g., SHA-1 or MD5), only that the value is deterministic for this particular location with its current contents. In other words: if a checksum differs from a previous inquiry, you can be sure the contents have changed; conversely, if the checksum is still the same, the contents are highly likely to be unchanged.
IOException - If something goes wrong when accessing the checksum.public long offset()
throws IOException
DataHandleIOExceptionpublic void seek(long pos)
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(byte[] b,
int off,
int len)
throws IOException
DataHandlelen bytes of data from the stream into an array of
bytes.IOExceptionpublic Class<Location> getType()
Typedpublic byte readByte()
throws IOException
IOExceptionpublic void write(int b)
throws IOException
IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2015–2022 SciJava. All rights reserved.