Interface Output<E extends Exception>

Type Parameters:
E - the exception type that can happen on output
All Known Subinterfaces:
BufferedEncodedOutput, ByteBufferEncodedOutput, ChunkEncodedOutput<T>, LimitEncodedOutput<T,E>, Output.CloseableEncodedOutput<E>, Output.EncodedOutput<E>
All Known Implementing Classes:
ByteBufferedOutputStream, ForwardingEncodedOutput, ForwardingOutput, Output.StringOutput, ThresholdEncodedOutput, ThresholdEncodedOutput.OutputStreamThresholdEncodedOutput

public interface Output<E extends Exception>
A low level abstraction and implementation detail analogous to Appendable and DataOutput.
Author:
agentgt
  • Method Details

    • append

      void append(CharSequence s) throws E
      Parameters:
      s - unlike appendable always non null.
      Throws:
      E - if an error happens while writting to the appendable
      API Note
      Implementations are required to implement this method.
    • append

      default void append(String s) throws E
      Analogous to Appendable.append(CharSequence) which by default treats the String as a CharSequence.
      Parameters:
      s - unlike appendable always non null.
      Throws:
      E - if an error happens while writting to the appendable
      API Note
      Implementations are required to implement this method.
    • append

      void append(CharSequence csq, int start, int end) throws E
      Parameters:
      csq - Unlike appendable never null.
      start - start inclusive
      end - end exclusive
      Throws:
      E - if an error happens while writting to the appendable
      API Note
      Implementations are required to implement this method.
    • append

      void append(char c) throws E
      Appends a character to an appendable.
      Parameters:
      c - character
      Throws:
      E - if an error happens while writting to the appendable
      API Note
      Implementations are required to implement this method.
    • append

      default void append(short s) throws E
      Write a short by using String.valueOf(int)
      Parameters:
      s - short
      Throws:
      E - if an error happens while writting to the appendable
    • append

      default void append(int i) throws E
      Write a int by using String.valueOf(int).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Parameters:
      i - int
      Throws:
      E - if an error happens while writting to the appendable
    • append

      default void append(long l) throws E
      Write a long by using String.valueOf(long).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Parameters:
      l - long
      Throws:
      E - if an error happens while writting to the appendable
    • append

      default void append(double d) throws E
      Write a long by using String.valueOf(long).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Parameters:
      d - double
      Throws:
      E - if an error happens while writting to the appendable
    • append

      default void append(boolean b) throws E
      Write a long by using String.valueOf(long).

      Implementations should override if they want different behavior or able to support appendables that can write the native type.

      Parameters:
      b - boolean
      Throws:
      E - if an error happens while writting to the appendable
    • of

      Adapts an OutputStream as an Output.
      Parameters:
      a - the OutputStream to be wrapped.
      charset - the encoding to use
      Returns:
      outputstream output
    • of

      Adapts an Appendable as an Output.
      Parameters:
      a - the appendable to be wrapped.
      Returns:
      string based output
    • of

      Adapts a StringBuilder as an Output.
      Parameters:
      a - the StringBuilder to be wrapped.
      Returns:
      string based output
    • toAppendable

      Converts the output to an appendable unless it already is one.
      Returns:
      adapted appendable of this output.