public class MacAuthenticatedInputStream extends FilterInputStream
in
Constructor and Description |
---|
MacAuthenticatedInputStream(InputStream in,
Mac mac) |
Modifier and Type | Method and Description |
---|---|
boolean |
isTagEqual(byte[] tag) |
int |
read()
Reads a single byte from the filtered stream and returns it as an integer
in the range from 0 to 255.
|
int |
read(byte[] buffer,
int offset,
int count)
Reads at most
count bytes from this stream and stores them in the
byte array buffer starting at offset . |
available, close, mark, markSupported, reset, skip
read
public MacAuthenticatedInputStream(InputStream in, Mac mac)
public boolean isTagEqual(byte[] tag)
public int read() throws IOException
FilterInputStream
read
in class FilterInputStream
IOException
- if the stream is closed or another IOException occurs.public int read(byte[] buffer, int offset, int count) throws IOException
FilterInputStream
count
bytes from this stream and stores them in the
byte array buffer
starting at offset
. Returns the number
of bytes actually read or -1 if no bytes have been read and the end of
this stream has been reached. This implementation reads bytes from the
filtered stream.read
in class FilterInputStream
buffer
- the byte array in which to store the bytes read.offset
- the initial position in buffer
to store the bytes
read from this stream.count
- the maximum number of bytes to store in buffer
.IOException
- if this stream is closed or another I/O error occurs.