Class ByteSourceFile
- java.lang.Object
-
- org.apache.commons.imaging.common.bytesource.ByteSource
-
- org.apache.commons.imaging.common.bytesource.ByteSourceFile
-
public class ByteSourceFile extends ByteSource
-
-
Constructor Summary
Constructors Constructor Description ByteSourceFile(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getAll()byte[]getBlock(long start, int length)java.lang.StringgetDescription()java.io.InputStreamgetInputStream()longgetLength()This operation can be VERY expensive; for inputstream byte sources, the entire stream must be drained to determine its length.-
Methods inherited from class org.apache.commons.imaging.common.bytesource.ByteSource
getBlock, getFileName, getInputStream
-
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin classByteSource- Throws:
java.io.IOException
-
getBlock
public byte[] getBlock(long start, int length) throws java.io.IOException- Specified by:
getBlockin classByteSource- Throws:
java.io.IOException
-
getLength
public long getLength()
Description copied from class:ByteSourceThis operation can be VERY expensive; for inputstream byte sources, the entire stream must be drained to determine its length.- Specified by:
getLengthin classByteSource- Returns:
- the byte source length
-
getAll
public byte[] getAll() throws java.io.IOException- Specified by:
getAllin classByteSource- Throws:
java.io.IOException
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin classByteSource
-
-