All Implemented Interfaces:
Closeable, AutoCloseable

public class ReusableGZIPInputStreamextends ResettableGZIPInputStream
Provide a cache of reusable GZIP unzipper streams. This provides stream output only, and therefore can handle unlimited size.
  • Field Details

    • ENABLE_CACHING

      private static final boolean ENABLE_CACHING
      False on Apache Harmony 5.0M13 and on Android, where the deflater does not work after reset().
    • _available

      private static final LinkedBlockingQueue<ReusableGZIPInputStream> _available
      Streams ready for reuse.
  • Constructor Details

    • ReusableGZIPInputStream

      private ReusableGZIPInputStream()
      Makes a stream with an empty buffer.
  • Method Details

    • acquire

      public static ReusableGZIPInputStream acquire()
      Pull a cached instance.
      Returns:
      a pooled instance if one is free, otherwise a newly constructed one
    • release

      public static void release(ReusableGZIPInputStream released)
      Release an instance back into the cache (this will reset the state).
      Parameters:
      released - the instance being handed back; destroyed instead when the pool is full or caching is disabled
    • clearCache

      public static void clearCache()
      Clear the cache.