@Test public void readsDifferentEncoding() throws Exception { Files.write(storageFile, Arrays.asList("!evelyn-db", "!version=x.y", "!custom=CharactèreSpéciale", "!data"), Charset.forName("ISO-8859-1")); assertThat(fileStorage.read(Charset.forName("ISO-8859-1"))) .containsExactly( "!evelyn-db", "!version=x.y", "!custom=CharactèreSpéciale", "!data" ); }
@Override public Stream<String> read(Charset charset) { try { return Files.lines(location, charset); } catch (IOException e) { throw new UncheckedIOException(e); } }
FileStorage extends StorageSupport { @Override public Stream<String> read(Charset charset) { try { return Files.lines(location, charset); } catch (IOException e) { throw new UncheckedIOException(e); } } }
FileStorage extends StorageSupport { @Override public Stream<String> read(Charset charset) { try { return Files.lines(location, charset); } catch (IOException e) { throw new UncheckedIOException(e); } } FileStorage(Path location); }
FileStorage extends StorageSupport { @Override public Stream<String> read(Charset charset) { try { return Files.lines(location, charset); } catch (IOException e) { throw new UncheckedIOException(e); } } FileStorage(Path location); @Override String getReference(); @Override void append(String data); @Override Stream<String> read(Charset charset); }
FileStorage extends StorageSupport { @Override public Stream<String> read(Charset charset) { try { return Files.lines(location, charset); } catch (IOException e) { throw new UncheckedIOException(e); } } FileStorage(Path location); @Override String getReference(); @Override void append(String data); @Override Stream<String> read(Charset charset);  }