UnicodeUtil { public static BufferedReader getUnicodeAwareBufferedReader(String file) throws IOException { return getUnicodeAwareBufferedReader(new FileInputStream(file)); }  static byte[] convert(final byte[] bytes, final String desiredOutputEncoding); static String getBOM(final String enc); static BufferedReader getUnicodeAwareBufferedReader(String file); static BufferedReader getUnicodeAwareBufferedReader(InputStream stream);  }
@Test public void canReadAndDecodeLineByLine() throws IOException, URISyntaxException { String filename = this.getClass().getResource(SAMPLE_UTF_16LE_TXT).toURI().getPath(); BufferedReader reader = UnicodeUtil.getUnicodeAwareBufferedReader(filename); String read = reader.readLine(); reader.close(); assertThat(read.trim(), is(EXPECTED_CONTENT)); }