Class RewindableInputStream
java.lang.Object
java.io.InputStream
nu.validator.htmlparser.rewindable.RewindableInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Rewindable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RewindableInputStream.Block
private int
If curBlockAvail > 0, then there are curBlockAvail bytes available to be returned starting at curBlockPos in curBlock.buf.private int
private boolean
true if we have got an EOF from the underlying InputStreamprivate RewindableInputStream.Block
private final InputStream
private RewindableInputStream.Block
private boolean
private boolean
true unless willNotRewind has been called -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
head
-
curBlockAvail
private int curBlockAvailIf curBlockAvail > 0, then there are curBlockAvail bytes available to be returned starting at curBlockPos in curBlock.buf. -
curBlock
-
curBlockPos
private int curBlockPos -
lastBlock
-
saving
private boolean savingtrue unless willNotRewind has been called -
in
-
pretendClosed
private boolean pretendClosed -
eof
private boolean eoftrue if we have got an EOF from the underlying InputStream
-
-
Constructor Details
-
RewindableInputStream
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
rewind
public void rewind()- Specified by:
rewind
in interfaceRewindable
-
canRewind
public boolean canRewind()- Specified by:
canRewind
in interfaceRewindable
-
willNotRewind
public void willNotRewind()- Specified by:
willNotRewind
in interfaceRewindable
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-