@Test(expected = MalformedInputException.class)
public void testLatin1DecodeErrorHandlingFailMalformed() throws IOException {

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  generateLatin1InvalidSequence(out);
  Files.write(out.toByteArray(), file);
  ResettableInputStream in = initInputStream(DecodeErrorPolicy.FAIL);
  while (in.readChar() != -1) {
    // Do nothing... read the whole file and throw away the bytes.
  }
  fail("Expected MalformedInputException!");
}