Class ReaderInputStream.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • get

        public ReaderInputStream get()
                              throws java.io.IOException
        Constructs a new instance.

        This builder use the aspects Reader, Charset, CharsetEncoder, buffer size.

        You must provide an origin that can be converted to a Reader by this builder, otherwise, this call will throw an UnsupportedOperationException.

        Returns:
        a new instance.
        Throws:
        java.lang.UnsupportedOperationException - if the origin cannot provide a Reader.
        java.lang.IllegalStateException - if the origin is null.
        java.io.IOException - if an I/O error occurs.
        See Also:
        AbstractOrigin.getReader(Charset)
      • setCharsetEncoder

        public ReaderInputStream.Builder setCharsetEncoder​(java.nio.charset.CharsetEncoder newEncoder)
        Sets the charset encoder. Assumes that the caller has configured the encoder.
        Parameters:
        newEncoder - the charset encoder, null resets to a default encoder.
        Returns:
        this