Class MultiWriteHandle

    • Constructor Detail

      • MultiWriteHandle

        public MultiWriteHandle​(DataHandle<?>... handles)
    • Method Detail

      • isReadable

        public boolean isReadable()
        Description copied from interface: DataHandle
        Gets whether reading from this handle is supported.
      • isWritable

        public boolean isWritable()
        Description copied from interface: DataHandle
        Gets whether writing to this handle is supported.
      • exists

        public boolean exists()
                       throws IOException
        Description copied from interface: DataHandle
        Tests whether this handle's location actually exists at the source.
        Returns:
        True if the location exists; false if not.
        Throws:
        IOException - If something goes wrong with the existence check.
      • lastModified

        public Date lastModified()
                          throws IOException
        Description copied from interface: DataHandle
        Gets the last modified timestamp of the location.
        Returns:
        The last modified timestamp, or null if the handle does not support this feature or if the location does not exist.
        Throws:
        IOException - If something goes wrong with the last modified check.
      • checksum

        public String checksum()
                        throws IOException
        Description copied from interface: DataHandle
        Gets a "fast" checksum which succinctly represents the contents of the data stream. The term "fast" here refers to the idea that the checksum be retrievable quickly, without actually performing a thorough computation across the entire data stream. Typically, such a thing is feasible because the checksum was calculated a priori; e.g., artifacts deployed to remote Maven repositories are always deployed with corresponding checksum files.

        No 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.

        Returns:
        The checksum, or null if the handle does not support this feature.
        Throws:
        IOException - If something goes wrong when accessing the checksum.
      • seek

        public void seek​(long pos)
                  throws IOException
        Description copied from interface: DataHandle
        Sets the stream offset, measured from the beginning of the stream, at which the next read or write occurs.
        Throws:
        IOException
      • length

        public long length()
                    throws IOException
        Description copied from interface: DataHandle
        Returns the length of the data in bytes.
        Returns:
        The length, or -1 if the length is unknown.
        Throws:
        IOException
      • setLength

        public void setLength​(long length)
                       throws IOException
        Description copied from interface: DataHandle
        Sets the new length of the handle.
        Parameters:
        length - New length.
        Throws:
        IOException - If there is an error changing the handle's length.
      • 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
      • getType

        public Class<Location> getType()
        Description copied from interface: Typed
        Gets the type associated with the object.