Class AbstractOrigin.PathOrigin

    • Constructor Detail

      • PathOrigin

        public PathOrigin​(java.nio.file.Path 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.nio.file.Path,​AbstractOrigin.PathOrigin>
        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.
      • getPath

        public java.nio.file.Path getPath()
        Gets this origin as a Path, if possible.

        No conversion should occur when calling this method.

        Overrides:
        getPath in class AbstractOrigin<java.nio.file.Path,​AbstractOrigin.PathOrigin>
        Returns:
        this origin as a Path, if possible.