@@ -0,0 +1,1448 @@
+package com.googlecode.mp4parser;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.nio.ByteBuffer;%0D%0Aimport java.nio.channels.WritableByteChannel;%0D%0A%0D%0Aimport static com.googlecode.mp4parser.util.CastUtils.l2i;%0D%0A%0D%0A/**%0D%0A * Created by sannies on 10/15/13.%0D%0A */%0D%0Apublic class MemoryDataSourceImpl implements DataSource %7B%0D%0A    ByteBuffer data;%0D%0A%0D%0A    public MemoryDataSourceImpl(byte%5B%5D data) %7B%0D%0A        this.data = ByteBuffer.wrap(data);%0D%0A    %7D%0D%0A%0D%0A    public int read(ByteBuffer byteBuffer) throws IOException %7B%0D%0A        byte%5B%5D buf = new byte%5BMath.min(byteBuffer.remaining(), data.remaining())%5D;%0D%0A        data.get(buf);%0D%0A        byteBuffer.put(buf);%0D%0A        return buf.length;%0D%0A    %7D%0D%0A%0D%0A    public long size() throws IOException %7B%0D%0A        return data.capacity();%0D%0A    %7D%0D%0A%0D%0A    public long position() throws IOException %7B%0D%0A        return data.position();%0D%0A    %7D%0D%0A%0D%0A    public void position(long nuPos) throws IOException %7B%0D%0A        data.position(l2i(nuPos));%0D%0A    %7D%0D%0A%0D%0A    public long transferTo(long position, long count, WritableByteChannel target) throws IOException %7B%0D%0A        return target.write((ByteBuffer) ((ByteBuffer) data.position(l2i(position))).slice().limit(l2i(count)));%0D%0A    %7D%0D%0A%0D%0A    public ByteBuffer map(long startPosition, long size) throws IOException %7B%0D%0A        return (ByteBuffer) ((ByteBuffer) data.position(l2i(startPosition))).slice().limit(l2i(size));%0D%0A    %7D%0D%0A%0D%0A    public void close() throws IOException %7B%0D%0A        //nop%0D%0A    %7D%0D%0A%7D%0D%0A

add memorydatasourceimpl