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 booleanDeprecated.private booleanDeprecated.private final intDeprecated.private intDeprecated.private longDeprecated.private longDeprecated.Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstrainableInputStream(InputStream in, int bufferSize, int maxSize) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanexpired()Deprecated.intread(byte[] b, int off, int len) Deprecated.readToByteBuffer(int max) Deprecated.Reads this inputstream to a ByteBuffer.voidreset()Deprecated.timeout(long startTimeNanos, long timeoutMillis) Deprecated.static ConstrainableInputStreamwrap(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, transferToMethods inherited from class java.io.FilterInputStream
readMethods 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:
readin 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:
resetin classBufferedInputStream- Throws:
IOException
-
timeout
Deprecated. -
expired
private boolean expired()Deprecated.
-
ControllableInputStreaminstead (but don't use that either, because this is jsoup internal!)