public class TLVInputStream extends InputStream
| Constructor and Description |
|---|
TLVInputStream(InputStream inputStream)
Constructs a new TLV stream based on another stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or
skipped over) from this input-stream without blocking by the next
invocation of a method for this input-stream.
|
void |
close()
Closes this input-stream.
|
void |
mark(int readLimit)
Marks the underlying input-stream if supported.
|
boolean |
markSupported()
Whether marking and resetting are supported.
|
int |
read()
Reads the next byte of data from the input-stream.
|
int |
readLength()
Reads a length.
|
int |
readTag()
Reads a tag.
|
byte[] |
readValue()
Reads a value.
|
void |
reset()
Resets the underlying input-stream if supported.
|
long |
skip(long n)
Attempts to skip over
n bytes. |
void |
skipToTag(int searchTag)
Skips in this stream until a given tag is found (depth first).
|
String |
toString() |
read, readpublic TLVInputStream(InputStream inputStream)
inputStream - a TLV objectpublic int readTag()
throws IOException
IOException - if reading goes wrongpublic int readLength()
throws IOException
IOException - if reading goes wrongpublic byte[] readValue()
throws IOException
IOException - if reading goes wrongpublic void skipToTag(int searchTag)
throws IOException
searchTag - the tag to search forIOException - on errorpublic int available()
throws IOException
available in class InputStreamIOException - if something goes wrongpublic int read()
throws IOException
read in class InputStreamIOException - if reading goes wrongpublic long skip(long n)
throws IOException
n bytes.skip in class InputStreamIOException - if something goes wrongpublic void mark(int readLimit)
mark in class InputStreamreadLimit - limit for markingpublic boolean markSupported()
markSupported in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOException - if something goes wrongpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException - if something goes wrongCopyright © 2020. All rights reserved.