Class ByteSourceInputStream
java.lang.Object
org.apache.commons.imaging.common.bytesource.ByteSource
org.apache.commons.imaging.common.bytesource.ByteSourceInputStream
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private ByteSourceInputStream.CacheBlock
private final InputStream
private byte[]
private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getAll()
byte[]
getBlock
(long blockStart, int blockLength) private ByteSourceInputStream.CacheBlock
long
This operation can be VERY expensive; for inputstream byte sources, the entire stream must be drained to determine its length.private ByteSourceInputStream.CacheBlock
Methods inherited from class org.apache.commons.imaging.common.bytesource.ByteSource
getBlock, getFileName, getInputStream
-
Field Details
-
BLOCK_SIZE
private static final int BLOCK_SIZE- See Also:
-
is
-
cacheHead
-
readBuffer
private byte[] readBuffer -
streamLength
private long streamLength
-
-
Constructor Details
-
ByteSourceInputStream
-
-
Method Details
-
readBlock
- Throws:
IOException
-
getFirstBlock
- Throws:
IOException
-
getInputStream
- Specified by:
getInputStream
in classByteSource
- Throws:
IOException
-
getBlock
- Specified by:
getBlock
in classByteSource
- Throws:
IOException
-
getLength
Description copied from class:ByteSource
This operation can be VERY expensive; for inputstream byte sources, the entire stream must be drained to determine its length.- Specified by:
getLength
in classByteSource
- Returns:
- the byte source length
- Throws:
IOException
- if it fails to read the byte source data
-
getAll
- Specified by:
getAll
in classByteSource
- Throws:
IOException
-
getDescription
- Specified by:
getDescription
in classByteSource
-