Interface TupleReader

All Superinterfaces:
AutoCloseable, Closeable

public interface TupleReader extends Closeable

Simple interface for something that reads Tuples from an underlying stream of data

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    forEach(Struct expected, Consumer<Tuple> consumer)
    Pass all the tuples to the given consumer until the stream is exhausted.
    read(Struct expected)
    Read a Tuple of the given type from the underlying stream.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • read

      Tuple read(Struct expected) throws IOException

      Read a Tuple of the given type from the underlying stream.

      Parameters:
      expected - the type to read. Must be the type that was written, or bad things will happen
      Returns:
      the tuple that was read, null if there's nothing left.
      Throws:
      IOException
    • forEach

      default void forEach(Struct expected, Consumer<Tuple> consumer) throws IOException

      Pass all the tuples to the given consumer until the stream is exhausted.

      Throws:
      IOException