@Test public void testWrite() throws Exception { assertInput("12\n54321\n23456789\n345670981"); assertInput("12\n54321\n23456789\n345670981\n"); }
@Override public void write(char[] cbuf, int off, int len) throws IOException { CharBuffer buf = CharBuffer.wrap(cbuf, off, len); while (buf.hasRemaining()) { char c = buf.get(); if (c == '\n') { add(); } else { value.append(c); } } add(); }
IntArrayPgWriter extends Writer { @Override public void write(char[] cbuf, int off, int len) throws IOException { CharBuffer buf = CharBuffer.wrap(cbuf, off, len); while (buf.hasRemaining()) { char c = buf.get(); if (c == '\n') { add(); } else { value.append(c); } } add(); } }
IntArrayPgWriter extends Writer { @Override public void write(char[] cbuf, int off, int len) throws IOException { CharBuffer buf = CharBuffer.wrap(cbuf, off, len); while (buf.hasRemaining()) { char c = buf.get(); if (c == '\n') { add(); } else { value.append(c); } } add(); }  }
IntArrayPgWriter extends Writer { @Override public void write(char[] cbuf, int off, int len) throws IOException { CharBuffer buf = CharBuffer.wrap(cbuf, off, len); while (buf.hasRemaining()) { char c = buf.get(); if (c == '\n') { add(); } else { value.append(c); } } add(); }  @Override void close(); @Override void flush(); @Override void write(char[] cbuf, int off, int len); List<Integer> result(); }
IntArrayPgWriter extends Writer { @Override public void write(char[] cbuf, int off, int len) throws IOException { CharBuffer buf = CharBuffer.wrap(cbuf, off, len); while (buf.hasRemaining()) { char c = buf.get(); if (c == '\n') { add(); } else { value.append(c); } } add(); }  @Override void close(); @Override void flush(); @Override void write(char[] cbuf, int off, int len); List<Integer> result();  }