Class ByteSource
java.lang.Object
org.apache.commons.imaging.bytesource.ByteSource
- Direct Known Subclasses:
InputStreamByteSource
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByteSource(org.apache.commons.io.build.AbstractOrigin<?, ?> origin, String fileName) -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteSourcearray(byte[] array) static ByteSourcestatic ByteSourcebyte[]getByteArray(long position, int length) final Stringstatic final InputStreamgetInputStream(ByteSource byteSource, long skip) static ByteSourceinputStream(InputStream is, String name) static ByteSourcelongsize()This operation can be VERY expensive; for InputStream byte sources, the entire stream must be drained to determine its length.toString()
-
Field Details
-
fileName
-
origin
private final org.apache.commons.io.build.AbstractOrigin<?,?> origin
-
-
Constructor Details
-
ByteSource
ByteSource(org.apache.commons.io.build.AbstractOrigin<?, ?> origin, String fileName)
-
-
Method Details
-
array
-
array
-
file
-
getInputStream
- Throws:
IOException
-
inputStream
- Throws:
IOException
-
path
-
getByteArray
- Throws:
IOException
-
getFileName
-
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
-