Search in sources :

Example 1 with ReadableDataSink

use of com.android.apksig.util.ReadableDataSink in project apksig by venshine.

the class ChainedDataSourceTest method feedAllPossibleRanges.

@Test
public void feedAllPossibleRanges() throws Exception {
    for (int begin = 0; begin < mChain.size(); begin++) {
        for (int end = begin + 1; end < mChain.size(); end++) {
            int size = end - begin;
            ReadableDataSink sink = DataSinks.newInMemoryDataSink(size);
            mChain.feed(begin, size, sink);
            assertByteBufferEquals(ByteBuffer.wrap("1234567890".substring(begin, end).getBytes(US_ASCII)), sink.getByteBuffer(0, size));
        }
    }
}
Also used : ReadableDataSink(com.android.apksig.util.ReadableDataSink) Test(org.junit.Test)

Aggregations

ReadableDataSink (com.android.apksig.util.ReadableDataSink)1 Test (org.junit.Test)1