public final class SignatureStream
extends java.io.ByteArrayInputStream
signaturePrefixLength
bytes of another input stream, used to
allow multiple codecs to probe those bytes for a file format/version signature.Constructor and Description |
---|
SignatureStream(int signaturePrefixLength,
byte[] signaturePrefix)
Create a signature probe stream containing the first signaturePrefixLength bytes of an input
stream that can be probed for a signature.
|
Modifier and Type | Method and Description |
---|---|
int |
getSignaturePrefixLength()
Get the maximum number of bytes that can be consumed from this stream.
|
public SignatureStream(int signaturePrefixLength, byte[] signaturePrefix)
signaturePrefixLength
- signaturePrefixLength should be expressed in "compressed(/encrypted)" space
rather than "plaintext" space. For example, a raw signature may be n
bytes of decompressed ASCII, but the codec may need to consume an entire
encrypted GZIP block in order to inspect those n
bytes.
signaturePrefixLength should be specified based on the block size, in order
to ensure that the signature probe stream contains a semantically meaningful
fragment of the underlying input.signaturePrefix
- the bytes containing the signature, over which the probe stream will be created