Package org.apache.commons.imaging.common.bytesource

## 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​(File file)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `byte[]` | `getAll()` |
    `byte[]` | `getBlock​(long start, int length)` |
    `String` | `getDescription()` |
    `InputStream` | `getInputStream()` |
    `long` | `getLength()` | 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ByteSourceFile

          public ByteSourceFile​(File file)

  - ### Method Detail

    - #### getInputStream

          public InputStream getInputStream()
                                     throws IOException

      Specified by:
        `getInputStream` in class `ByteSource`
      Throws:
        `IOException`

    - #### getBlock

          public byte[] getBlock​(long start,
                                 int length)
                          throws IOException

      Specified by:
        `getBlock` in class `ByteSource`
      Throws:
        `IOException`

    - #### getLength

          public long getLength()

      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.
      Specified by:
        `getLength` in class `ByteSource`
      Returns:
        the byte source length

    - #### getAll

          public byte[] getAll()
                        throws IOException

      Specified by:
        `getAll` in class `ByteSource`
      Throws:
        `IOException`

    - #### getDescription

          public String getDescription()

      Specified by:
        `getDescription` in class `ByteSource`