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));
}
}
}
Aggregations