Class InputStreamByteSource
java.lang.Object
org.apache.commons.imaging.bytesource.ByteSource
org.apache.commons.imaging.bytesource.InputStreamByteSource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classA block of bytes (a byte array).private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final InputStreamByteSource.Blockprivate final InputStreamprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getByteArray(long position, int length) private InputStreamByteSource.Blockprivate InputStreamByteSource.Blocklongsize()This operation can be VERY expensive; for InputStream byte sources, the entire stream must be drained to determine its length.Methods inherited from class ByteSource
array, array, file, getFileName, getInputStream, inputStream, path, toString
-
Field Details
-
BLOCK_SIZE
private static final int BLOCK_SIZE- See Also:
-
inputStream
-
headBlock
-
streamLength
private long streamLength
-
-
Constructor Details
-
InputStreamByteSource
InputStreamByteSource(InputStream inputStream, String fileName) throws IOException - Throws:
IOException
-
-
Method Details
-
getByteArray
- Overrides:
getByteArrayin classByteSource- Throws:
IOException
-
getFirstBlock
- Throws:
IOException
-
getInputStream
- Overrides:
getInputStreamin classByteSource- Throws:
IOException
-
readBlock
- Throws:
IOException
-
size
Description copied from class:ByteSourceThis operation can be VERY expensive; for InputStream byte sources, the entire stream must be drained to determine its length.- Overrides:
sizein classByteSource- Returns:
- the byte source length
- Throws:
IOException- if it fails to read the byte source data
-