Class CachingInputStream

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

    class CachingInputStream
    extends java.io.InputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.ByteArrayOutputStream baos  
      private java.io.InputStream is  
    • Constructor Summary

      Constructors 
      Constructor Description
      CachingInputStream​(java.io.InputStream is)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      void close()  
      byte[] getCache()  
      int read()  
      • Methods inherited from class java.io.InputStream

        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
    • Field Detail

      • is

        private final java.io.InputStream is
      • baos

        private final java.io.ByteArrayOutputStream baos
    • Constructor Detail

      • CachingInputStream

        CachingInputStream​(java.io.InputStream is)
    • Method Detail

      • getCache

        public byte[] getCache()
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException