Package org.jsoup.internal
Class ConstrainableInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.jsoup.internal.ConstrainableInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Deprecated.
A jsoup internal class (so don't use it as there is no contract API) that enables constraints on an Input Stream,
namely a maximum read size, and the ability to Thread.interrupt() the read.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
Deprecated.private boolean
Deprecated.private final int
Deprecated.private int
Deprecated.private long
Deprecated.private long
Deprecated.Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ConstrainableInputStream
(InputStream in, int bufferSize, int maxSize) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
expired()
Deprecated.int
read
(byte[] b, int off, int len) Deprecated.readToByteBuffer
(int max) Deprecated.Reads this inputstream to a ByteBuffer.void
reset()
Deprecated.timeout
(long startTimeNanos, long timeoutMillis) Deprecated.static ConstrainableInputStream
wrap
(InputStream in, int bufferSize, int maxSize) Deprecated.If this InputStream is not already a ConstrainableInputStream, let it be one.Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, skip, transferTo
Methods inherited from class java.io.FilterInputStream
read
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes
-
Field Details
-
capped
private final boolean cappedDeprecated. -
maxSize
private final int maxSizeDeprecated. -
startTime
private long startTimeDeprecated. -
timeout
private long timeoutDeprecated. -
remaining
private int remainingDeprecated. -
interrupted
private boolean interruptedDeprecated.
-
-
Constructor Details
-
ConstrainableInputStream
Deprecated.
-
-
Method Details
-
wrap
Deprecated.If this InputStream is not already a ConstrainableInputStream, let it be one.- Parameters:
in
- the input stream to (maybe) wrapbufferSize
- the buffer size to use when readingmaxSize
- the maximum size to allow to be read. 0 == infinite.- Returns:
- a constrainable input stream
-
read
Deprecated.- Overrides:
read
in classBufferedInputStream
- Throws:
IOException
-
readToByteBuffer
Deprecated.Reads this inputstream to a ByteBuffer. The supplied max may be less than the inputstream's max, to support reading just the first bytes.- Throws:
IOException
-
reset
Deprecated.- Overrides:
reset
in classBufferedInputStream
- Throws:
IOException
-
timeout
Deprecated. -
expired
private boolean expired()Deprecated.
-
ControllableInputStream
instead (but don't use that either, because this is jsoup internal!)