final class LimitedInputStream extends FilterInputStream
Wraps a InputStream, limiting the number of bytes which can be read.
This code is from Guava's 14.0 source code, because there is no compatible way to use this functionality in both a Guava 11 environment and a Guava >14 environment.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- LimitedInputStream
- FilterInputStream
- InputStream
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new LimitedInputStream(in: InputStream, limit: Long, closeWrappedStream: Boolean)
Create a LimitedInputStream that will read
limitbytes fromin.Create a LimitedInputStream that will read
limitbytes fromin.If
closeWrappedStreamis true, this will closeinwhen it is closed. Otherwise, the stream is left open for reading its remaining content.- in
a
InputStreamto read from- limit
the number of bytes to read
- closeWrappedStream
whether to close
inwhen#closeis called
- new LimitedInputStream(in: InputStream, limit: Long)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def available(): Int
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream
- Annotations
- @Override()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Unit
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream → Closeable → AutoCloseable
- Annotations
- @Override()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mark(readLimit: Int): Unit
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream
- Annotations
- @Override()
- def markSupported(): Boolean
- Definition Classes
- FilterInputStream → InputStream
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def read(b: Array[Byte], off: Int, len: Int): Int
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream
- Annotations
- @Override()
- def read(): Int
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream
- Annotations
- @Override()
- def read(arg0: Array[Byte]): Int
- Definition Classes
- FilterInputStream → InputStream
- Annotations
- @throws(classOf[java.io.IOException])
- def reset(): Unit
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream
- Annotations
- @Override()
- def skip(n: Long): Long
- Definition Classes
- LimitedInputStream → FilterInputStream → InputStream
- Annotations
- @Override()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()