Class SizeLimitInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
gov.usgs.earthquake.util.SizeLimitInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class SizeLimitInputStream extends FilterInputStream
Stream that only allows a certain number of bytes to be read. Current implementation only tracks read bytes, and ignores any mark or reset calls.
  • Constructor Details

    • SizeLimitInputStream

      public SizeLimitInputStream(InputStream in, long limit)
      Construct a new SizeLimitInputStream.
      Parameters:
      in - stream to limit.
      limit - maximum number of bytes allowed to read.
  • Method Details