Interface Pipe.Decoder<T>

Enclosing interface:
Pipe
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Pipe.Decoder<T>
Support for efficiently reading complex objects from a pipe.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(T object, int length, byte[] buffer, int offset)
    Called to decode an object.
    default T
    decode(T object, int length, Pipe pipe)
    Called to decode an object when the requested length was too large.
  • Method Details

    • decode

      T decode(T object, int length, byte[] buffer, int offset) throws IOException
      Called to decode an object.
      Parameters:
      object - object which was passed to the readDecode method
      length - requested buffer length
      buffer - buffer to decode from
      offset - buffer offset to start reading from
      Returns:
      the actual decoded object
      Throws:
      IOException
    • decode

      default T decode(T object, int length, Pipe pipe) throws IOException
      Called to decode an object when the requested length was too large. By default, a temporary buffer is allocated and then the regular decode method is called.
      Parameters:
      object - object which was passed to the readDecode method
      length - requested buffer length
      pipe - pipe to read from
      Throws:
      IOException