Class InfiniteCircularInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class InfiniteCircularInputStream
    extends java.io.InputStream
    An InputStream that infinitely repeats provided bytes.

    Closing a InfiniteCircularInputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

    • Constructor Summary

      Constructors 
      Constructor Description
      InfiniteCircularInputStream​(byte[] repeatedContent)
      Creates a InfiniteCircularStream from the specified array of chars.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read()  
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • InfiniteCircularInputStream

        public InfiniteCircularInputStream​(byte[] repeatedContent)
        Creates a InfiniteCircularStream from the specified array of chars.
        Parameters:
        repeatedContent - Input buffer to be repeated (not copied)
    • Method Detail

      • read

        public int read()
        Specified by:
        read in class java.io.InputStream