Class AbstractOrigin.InputStreamOrigin

    • Constructor Detail

      • InputStreamOrigin

        public InputStreamOrigin​(java.io.InputStream origin)
        Constructs a new instance for the given origin.
        Parameters:
        origin - The origin.
    • Method Detail

      • getByteArray

        public byte[] getByteArray()
                            throws java.io.IOException
        Description copied from class: AbstractOrigin
        Gets this origin as a byte array, if possible.
        Overrides:
        getByteArray in class AbstractOrigin<java.io.InputStream,​AbstractOrigin.InputStreamOrigin>
        Returns:
        this origin as a byte array, if possible.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • getInputStream

        public java.io.InputStream getInputStream​(java.nio.file.OpenOption... options)
        Description copied from class: AbstractOrigin
        Gets this origin as an InputStream, if possible.
        Overrides:
        getInputStream in class AbstractOrigin<java.io.InputStream,​AbstractOrigin.InputStreamOrigin>
        Parameters:
        options - options specifying how the file is opened
        Returns:
        this origin as an InputStream, if possible.
      • getReader

        public java.io.Reader getReader​(java.nio.charset.Charset charset)
                                 throws java.io.IOException
        Description copied from class: AbstractOrigin
        Gets a new Reader on the origin, buffered by default.
        Overrides:
        getReader in class AbstractOrigin<java.io.InputStream,​AbstractOrigin.InputStreamOrigin>
        Parameters:
        charset - the charset to use for decoding
        Returns:
        a new Reader on the origin.
        Throws:
        java.io.IOException - if an I/O error occurs opening the file.