@Test
public void testTransformBytes() throws IOException {

  // In this case the "patch stream" is just a stream of addends that transformBytes(...) will
  // apply to the old data file.
  final byte[] patchInput = "this is a sample string to read".getBytes("US-ASCII");
  final ByteArrayInputStream patchInputStream = new ByteArrayInputStream(patchInput);
  copyToOldFile("bsdifftest_partial_a.txt");
  RandomAccessFile oldData = new RandomAccessFile(oldFile, "r");
  final byte[] expectedNewData = readTestData("bsdifftest_partial_b.bin");
  ByteArrayOutputStream newData = new ByteArrayOutputStream();
  BsPatch.transformBytes(patchInput.length, patchInputStream, oldData, newData, buffer1, buffer2);
  byte[] actual = newData.toByteArray();
  Assert.assertArrayEquals(expectedNewData, actual);
}