@Test
public void testTransformBytes_Error_JunkPatch() throws IOException {

  final byte[] patchInput = "this is a second sample string to read".getBytes("US-ASCII");
  final ByteArrayInputStream patchInputStream = new ByteArrayInputStream(patchInput);
  copyToOldFile("bsdifftest_partial_a.txt"); // Any file would work here
  RandomAccessFile oldData = new RandomAccessFile(oldFile, "r");
  ByteArrayOutputStream newData = new ByteArrayOutputStream();
  try {
    BsPatch.transformBytes(
        patchInput.length, patchInputStream, oldData, newData, buffer1, buffer2);
    Assert.fail("Should have thrown an IOException");
  } catch (IOException expected) {
    // Pass
  }
}