Class AbstractOrigin.ReaderOrigin

    • Constructor Detail

      • ReaderOrigin

        public ReaderOrigin​(java.io.Reader 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.Reader,​AbstractOrigin.ReaderOrigin>
        Returns:
        this origin as a byte array, if possible.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • getCharSequence

        public java.lang.CharSequence getCharSequence​(java.nio.charset.Charset charset)
                                               throws java.io.IOException
        Description copied from class: AbstractOrigin
        Gets this origin as a byte array, if possible.
        Overrides:
        getCharSequence in class AbstractOrigin<java.io.Reader,​AbstractOrigin.ReaderOrigin>
        Parameters:
        charset - The charset to use if conversion from bytes is needed.
        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)
                                           throws java.io.IOException
        Description copied from class: AbstractOrigin
        Gets this origin as an InputStream, if possible.
        Overrides:
        getInputStream in class AbstractOrigin<java.io.Reader,​AbstractOrigin.ReaderOrigin>
        Parameters:
        options - options specifying how the file is opened
        Returns:
        this origin as an InputStream, if possible.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • 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.Reader,​AbstractOrigin.ReaderOrigin>
        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.