@Override public long length() throws IOException { long result = 0L; for (CharSource source : sources) { result += source.length(); } return result; }
@Override public long length() throws IOException { long result = 0L; for (CharSource source : sources) { result += source.length(); } return result; }
@Override public long length() throws IOException { long result = 0L; for (CharSource source : sources) { result += source.length(); } return result; }
public void testLength() throws IOException { assertEquals(expected.length(), source.length()); }
@Override public long length() throws IOException { long result = 0L; for (CharSource source : sources) { result += source.length(); } return result; }
@Override public long length() throws IOException { long result = 0L; for (CharSource source : sources) { result += source.length(); } return result; }
public void testLength() throws IOException { assertEquals(expected.length(), source.length()); }
public void testOfFileWithCharset() throws Exception { CharSource charSource = CharSources.ofFile(new File(fileName), Charsets.UTF_16LE); assertEquals(charSource.readFirstLine(), "Hello"); assertEquals(charSource.length(), 5); }
@Test public void testOfContentString() throws Exception { CharSource charSource = CharSources.ofContent("H\u0000e\u0000l\u0000l\u0000o\u0000"); assertEquals(charSource.readFirstLine(), "H\u0000e\u0000l\u0000l\u0000o\u0000"); assertEquals(charSource.length(), 10); }
public void testOfFile() throws Exception { CharSource charSource = CharSources.ofFile(new File(fileName)); assertEquals(charSource.readFirstLine(), "H\u0000e\u0000l\u0000l\u0000o\u0000"); assertEquals(charSource.length(), 10); }
public void testOfFileName() throws Exception { CharSource charSource = CharSources.ofFileName(fileName); assertEquals(charSource.readFirstLine(), "H\u0000e\u0000l\u0000l\u0000o\u0000"); assertEquals(charSource.length(), 10); }
@Test public void testOfContentByteArray() throws Exception { byte[] inputText = "H\u0000e\u0000l\u0000l\u0000o\u0000".getBytes(Charsets.UTF_8); CharSource charSource = CharSources.ofContent(inputText); assertEquals(charSource.readFirstLine(), "H\u0000e\u0000l\u0000l\u0000o\u0000"); assertEquals(charSource.length(), 10); }
@Test public void testOfContentByteArrayWithCharset() throws Exception { byte[] inputText = "H\u0000e\u0000l\u0000l\u0000o\u0000".getBytes(Charsets.UTF_8); CharSource charSource = CharSources.ofContent(inputText, Charsets.UTF_16LE); assertEquals(charSource.readFirstLine(), "Hello"); assertEquals(charSource.length(), 5); } }
public void testOfPath() throws Exception { CharSource charSource = CharSources.ofPath(Paths.get(fileName)); assertEquals(charSource.readFirstLine(), "H\u0000e\u0000l\u0000l\u0000o\u0000"); assertEquals(charSource.length(), 10); }
public void testOfPathWithCharset() throws Exception { CharSource charSource = CharSources.ofPath(Paths.get(fileName), Charsets.UTF_16LE); assertEquals(charSource.readFirstLine(), "Hello"); assertEquals(charSource.length(), 5); }
public void testOfFileNameWithCharset() throws Exception { CharSource charSource = CharSources.ofFileName(fileName, Charsets.UTF_16LE); assertEquals(charSource.readFirstLine(), "Hello"); assertEquals(charSource.length(), 5); }