Class AbstractOrigin.FileOrigin

    • Constructor Detail

      • FileOrigin

        public FileOrigin​(java.io.File origin)
        Constructs a new instance for the given origin.
        Parameters:
        origin - The origin, not null.
        Throws:
        java.lang.NullPointerException - if origin is null.
    • Method Detail

      • getByteArray

        public byte[] getByteArray​(long position,
                                   int length)
                            throws java.io.IOException
        Description copied from class: AbstractOrigin
        Gets a portion of this origin as a byte array, if possible.
        Overrides:
        getByteArray in class AbstractOrigin<java.io.File,​AbstractOrigin.FileOrigin>
        Parameters:
        position - the initial index of the range to be copied, inclusive.
        length - How many bytes to copy.
        Returns:
        this origin as a byte array, if possible.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • getFile

        public java.io.File getFile()
        Gets this origin as a File, if possible.

        No conversion should occur when calling this method.

        Overrides:
        getFile in class AbstractOrigin<java.io.File,​AbstractOrigin.FileOrigin>
        Returns:
        this origin as a File, if possible.