Package org.bouncycastle.crypto.io
Class MacInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.bouncycastle.crypto.io.MacInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MacInputStream extends FilterInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected Macmac-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description MacInputStream(InputStream stream, Mac mac)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacgetMac()intread()Reads a single byte from the filtered stream and returns it as an integer in the range from 0 to 255.intread(byte[] b, int off, int len)Reads up tobyteCountbytes from this stream and stores them in the byte arraybufferstarting atbyteOffset.-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
-
Methods inherited from class java.io.InputStream
read
-
-
-
-
Field Detail
-
mac
protected Mac mac
-
-
Constructor Detail
-
MacInputStream
public MacInputStream(InputStream stream, Mac mac)
-
-
Method Detail
-
read
public int read() throws IOExceptionDescription copied from class:FilterInputStreamReads a single byte from the filtered stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of this stream has been reached.- Overrides:
readin classFilterInputStream- Returns:
- the byte read or -1 if the end of the filtered stream has been reached.
- Throws:
IOException- if the stream is closed or another IOException occurs.
-
read
public int read(byte[] b, int off, int len) throws IOExceptionDescription copied from class:InputStreamReads up tobyteCountbytes from this stream and stores them in the byte arraybufferstarting atbyteOffset. Returns the number of bytes actually read or -1 if the end of the stream has been reached.- Overrides:
readin classFilterInputStream- Throws:
IOException- if the stream is closed or another IOException occurs.
-
getMac
public Mac getMac()
-
-