src/main/java/com/netflix/imflibrary/utils/ByteArrayByteRangeProvider.java [124:152]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            long bytesSkipped = bis.skip(rangeStart);
            if(bytesSkipped != rangeStart){
                throw new IOException(String.format("Could not skip %d bytes of data, possible truncated data", rangeStart));
            }

            int totalNumBytesRead = 0;
            while (totalNumBytesRead < totalNumBytesToRead)
            {
                int numBytesRead;
                numBytesRead = bis.read(bytes, totalNumBytesRead, totalNumBytesToRead - totalNumBytesRead);
                if (numBytesRead != -1)
                {
                    totalNumBytesRead += numBytesRead;
                }
                else
                {
                    throw new EOFException(String.format("Tried to read %d bytes from input stream, which ended after reading %d bytes",
                            totalNumBytesToRead, totalNumBytesRead));
                }

            }
        }

        return bytes;
    }

    public InputStream getByteRangeAsStream(long rangeStart, long rangeEnd) throws IOException {
        byte[] bytes = this.getByteRangeAsBytes(rangeStart, rangeEnd);
        return new ByteArrayInputStream(bytes);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/com/netflix/imflibrary/utils/FileByteRangeProvider.java [135:163]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            long bytesSkipped = bis.skip(rangeStart);
            if(bytesSkipped != rangeStart){
                throw new IOException(String.format("Could not skip %d bytes of data, possible truncated data", rangeStart));
            }

            int totalNumBytesRead = 0;
            while (totalNumBytesRead < totalNumBytesToRead)
            {
                int numBytesRead;
                numBytesRead = bis.read(bytes, totalNumBytesRead, totalNumBytesToRead - totalNumBytesRead);
                if (numBytesRead != -1)
                {
                    totalNumBytesRead += numBytesRead;
                }
                else
                {
                    throw new EOFException(String.format("Tried to read %d bytes from input stream, which ended after reading %d bytes",
                            totalNumBytesToRead, totalNumBytesRead));
                }

            }
        }

        return bytes;
    }

    public InputStream getByteRangeAsStream(long rangeStart, long rangeEnd) throws IOException {
        byte[] bytes = this.getByteRangeAsBytes(rangeStart, rangeEnd);
        return new ByteArrayInputStream(bytes);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



