@Test
public void testPipe_Underrun() {

  int dataLength = 10;
  ByteArrayInputStream in = new ByteArrayInputStream(new byte[dataLength]);
  try {
    // Tell pipe to copy 1 more byte than is actually available
    BsPatch.pipe(in, new ByteArrayOutputStream(), new byte[dataLength], dataLength + 1);
    Assert.fail("Should've thrown an IOException");
  } catch (IOException expected) {
    // Pass
  }
}