Class CircularArrayInput<T>

  • All Implemented Interfaces:
    Input<T>, java.io.Closeable, java.lang.AutoCloseable

    public class CircularArrayInput<T>
    extends ArrayInput<T>
    An array input which may use fixed count of the items for unlimited (circular) retrieving.
    • Field Summary

      • Fields inherited from interface com.github.akurilov.commons.io.Input

        DELIMITER
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()
      Get next item
      int get​(java.util.List<T> buffer, int maxCount)
      Bulk get into the specified buffer
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • CircularArrayInput

        public CircularArrayInput​(T[] items)
    • Method Detail

      • get

        public T get()
              throws java.io.IOException
        Description copied from interface: Input
        Get next item
        Specified by:
        get in interface Input<T>
        Overrides:
        get in class ArrayInput<T>
        Returns:
        next item
        Throws:
        java.io.EOFException - if no item available more
        java.io.IOException - if failed to get some-why
      • get

        public int get​(java.util.List<T> buffer,
                       int maxCount)
                throws java.io.EOFException,
                       java.io.IOException
        Description copied from class: ArrayInput
        Bulk get into the specified buffer
        Specified by:
        get in interface Input<T>
        Overrides:
        get in class ArrayInput<T>
        Parameters:
        buffer - buffer for the items
        maxCount - the count limit
        Returns:
        the actual count of the items got in the buffer
        Throws:
        java.io.EOFException - doesn't throw
        java.io.IOException - if failed to get some-why