Class Lines

java.lang.Object
net.pincette.rs.encoders.Lines
All Implemented Interfaces:
Encoder<ByteBuffer,String>

public class Lines extends Object implements Encoder<ByteBuffer,String>
An encoder that receives buffers and interprets the contents as a UTF-8 encoded string. It emits the individual lines in the string without the line separators.
Since:
3.0
Author:
Werner Donné
  • Constructor Details

    • Lines

      public Lines()
  • Method Details

    • lines

      public static Encoder<ByteBuffer,String> lines()
    • complete

      public List<String> complete()
      Description copied from interface: Encoder
      This method is called when the stream has completed. It provides the opportunity to generate the last values from remaining state.
      Specified by:
      complete in interface Encoder<ByteBuffer,String>
      Returns:
      The last values.
    • encode

      public List<String> encode(ByteBuffer buffer)
      Description copied from interface: Encoder
      This method is called for each incoming value.
      Specified by:
      encode in interface Encoder<ByteBuffer,String>
      Parameters:
      buffer - the value.
      Returns:
      The list of generated values.