Class JavaObjectFileSink.StreamChunker

  • Enclosing class:
    JavaObjectFileSink<T>

    public static class JavaObjectFileSink.StreamChunker
    extends java.lang.Object
    Utility to chunk a Stream into portions of fixed size.
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamChunker​(int chunkSize, java.util.function.BiConsumer<java.lang.Object[],​java.lang.Integer> action)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fire()
      Apply the specified action to the current chunk and prepare for a new chunk.
      void push​(java.lang.Object obj)
      Add a new element to the current chunk.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StreamChunker

        public StreamChunker​(int chunkSize,
                             java.util.function.BiConsumer<java.lang.Object[],​java.lang.Integer> action)
    • Method Detail

      • push

        public void push​(java.lang.Object obj)
        Add a new element to the current chunk. Fire, if the chunk is complete.
      • fire

        public void fire()
        Apply the specified action to the current chunk and prepare for a new chunk.