private int readIntoBlock(int offset, int length) throws IOException {
    int count = mInputStream.read(block, offset, length);
    mCurrentOffset += length;
    if (shouldFixStream) {
      Preconditions.checkNotNull(mOutputStream).write(block, offset, length);
    }
    if (count == -1) {
      throw new EOFException("Unexpected end of gif file");
    }
    return count;
  }
@param is InputStream to decode
@param os OutputStream to write fixed version of gif, if needed. (optional)
animated-gif-lite/src/main/java/com/facebook/animated/giflite/decoder/GifMetadataDecoder.java