Class ByteSource
java.lang.Object
org.apache.commons.imaging.bytesource.ByteSource
-
Constructor Summary
ConstructorDescriptionByteSource
(org.apache.commons.io.build.AbstractOrigin<?, ?> origin, String fileName) -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteSource
array
(byte[] array) static ByteSource
static ByteSource
byte[]
getByteArray
(long position, int length) final String
final InputStream
getInputStream
(long start) static ByteSource
inputStream
(InputStream is, String name) static ByteSource
long
size()
This operation can be VERY expensive; for InputStream byte sources, the entire stream must be drained to determine its length.toString()
-
Constructor Details
-
ByteSource
-
-
Method Details
-
array
-
array
-
file
-
inputStream
-
path
-
getByteArray
- Throws:
IOException
-
getFileName
-
getInputStream
- Throws:
IOException
-
getInputStream
- Throws:
IOException
-
size
This operation can be VERY expensive; for InputStream byte sources, the entire stream must be drained to determine its length.- Returns:
- the byte source length
- Throws:
IOException
- if it fails to read the byte source data
-
toString
-