src/main/java/org/jcodec/codecs/mpeg12/SegmentReader.java
public ByteBuffer readToNextMarkerNewBuffer() throws IOException {
        if (done)
            return null;
        List<ByteBuffer> buffers = new ArrayList<ByteBuffer>();
        readToNextMarkerBuffers(buffers);

        return NIOUtils.combineBuffers(buffers);
    }
public ByteBuffer readToNextMarkerNewBuffer() throws IOException {
        if (done)
            return null;
        List<ByteBuffer> buffers = new ArrayList<ByteBuffer>();
        readToNextMarkerBuffers(buffers);

        return NIOUtils.combineBuffers(buffers);
    }
Reads one full segment till the next marker. Will allocate the necessary
buffer to hold the full segment. Internally uses a growing collection of
smaller buffers since the segment size is intitially unkwnown.

@return
@throws IOException