Class InputStreamByteSource


  • final class InputStreamByteSource
    extends ByteSource
    • Constructor Detail

      • InputStreamByteSource

        InputStreamByteSource​(java.io.InputStream inputStream,
                              java.lang.String fileName)
                       throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getByteArray

        public byte[] getByteArray​(long position,
                                   int length)
                            throws java.io.IOException
        Overrides:
        getByteArray in class ByteSource
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Overrides:
        getInputStream in class ByteSource
        Throws:
        java.io.IOException
      • size

        public long size()
                  throws java.io.IOException
        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.
        Overrides:
        size in class ByteSource
        Returns:
        the byte source length
        Throws:
        java.io.IOException - if it fails to read the byte source data