Class MCRHeaderInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.mycore.common.content.streams.MCRBlockingInputStream
org.mycore.common.content.streams.MCRHeaderInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Provides the header of the stream that is read.
This may be useful for content type detection purposes.
Immediately after stream construction, getHeader() can be called.
- Author:
- Frank Lützenkirchen
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
The header of the stream readstatic final int
The number of bytes that will be read for content type detectionFields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns the header of the underlying input stream, at maximum MAX_HEADER_SIZE bytes.Methods inherited from class org.mycore.common.content.streams.MCRBlockingInputStream
read
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, reset, skip
Methods inherited from class java.io.FilterInputStream
read
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
MAX_HEADER_SIZE
public static final int MAX_HEADER_SIZEThe number of bytes that will be read for content type detection- See Also:
-
header
protected byte[] headerThe header of the stream read
-
-
Constructor Details
-
MCRHeaderInputStream
- Throws:
IOException
MCRException
-
-
Method Details
-
getHeader
public byte[] getHeader()Returns the header of the underlying input stream, at maximum MAX_HEADER_SIZE bytes.
-