public class HashedBlockInputStream extends InputStream
A Hashed block consists of:
The stream of blocks is terminated with a 0 length 0 hash block.
Originally developed for KeePass. A KeePass hash block stream is little endian, i.e. the sequence number and length fields are low order byte first.
| Constructor and Description |
|---|
HashedBlockInputStream(InputStream inputStream)
Create a Big Endian Hash Block Input Stream
|
HashedBlockInputStream(InputStream inputStream,
boolean littleEndian)
Create a Hash Block Input Stream with choice of endian encoding
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected int |
get(byte[] b,
int offset,
int length)
Gets bytes from the internal buffer and replenishes the buffer as necessary
|
protected void |
load()
Reload the internal buffer from the underlying input stream
|
int |
read() |
int |
read(@NotNull byte[] b,
int offset,
int length) |
available, mark, markSupported, read, reset, skippublic HashedBlockInputStream(InputStream inputStream)
inputStream - the input stream containing the hash blockspublic HashedBlockInputStream(InputStream inputStream, boolean littleEndian)
inputStream - the input stream containing the hash blockslittleEndian - true if the stream is little endian encodedpublic int read(@NotNull
@NotNull byte[] b,
int offset,
int length)
throws IOException
read in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionprotected int get(byte[] b,
int offset,
int length)
throws IOException
b - a byte array to filloffset - the offset to strat fromlength - the number of bytes to returnIOExceptionprotected void load()
throws IOException
IOExceptionCopyright © 2018. All rights reserved.