java.lang.Object
org.apache.commons.imaging.common.bytesource.ByteSource
Direct Known Subclasses:
ByteSourceArray, ByteSourceFile, ByteSourceInputStream

public abstract class ByteSource extends Object
  • Field Details

    • fileName

      private final String fileName
  • Constructor Details

    • ByteSource

      public ByteSource(String fileName)
  • Method Details

    • getInputStream

      public final InputStream getInputStream(long start) throws IOException
      Throws:
      IOException
    • getInputStream

      public abstract InputStream getInputStream() throws IOException
      Throws:
      IOException
    • getBlock

      public byte[] getBlock(int start, int length) throws IOException
      Throws:
      IOException
    • getBlock

      public abstract byte[] getBlock(long start, int length) throws IOException
      Throws:
      IOException
    • getAll

      public abstract byte[] getAll() throws IOException
      Throws:
      IOException
    • getLength

      public abstract long getLength() throws IOException
      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
    • getDescription

      public abstract String getDescription()
    • getFileName

      public final String getFileName()