public boolean ready() throws IOException { return current.ready(); }
@Override public boolean ready() throws IOException { return stringReader.ready(); }
@Override public boolean ready() throws IOException { return stringReader.ready(); }
@Override public boolean ready() throws IOException { return stringReader.ready(); }
public boolean ready() throws IOException { return current.ready(); }
public boolean ready() throws IOException { return mCurrent.ready(); }
public boolean ready() throws IOException { return freemarkerProcessedReader.ready(); }
/** * * @param file * @param xml * @throws JDOMException * @throws IOException */ protected static void writer(File file, String xml) throws JDOMException, IOException { FileWriter writer=null; StringReader reader=null; try { writer=new FileWriter(file); reader=new StringReader(xml); char[] cbuf=new char[2048]; int size=0; while (reader.ready() && (size=reader.read(cbuf))!=-1){ writer.write(cbuf,0,size); } } finally { writer.flush(); IOUtils.closeQuietly(writer); IOUtils.closeQuietly(reader); } }
StringWriter sw = new StringWriter(len); while (sr.ready()) { int ch = sr.read();
@Test public void testFoo() throws IOException { StringReader readable = new StringReader("HELLO"); StringBuilder buffer = new StringBuilder(); OutputStream appendable = OutputStream.create(Tools.UTF_8, buffer); appendable.provide(Chunk.create(readable)); assertEquals("HELLO", buffer.toString()); try { readable.ready(); fail(); } catch (IOException expected) { } } }
@Test public void testFoo() throws IOException { StringReader readable = new StringReader("HELLO"); StringBuilder buffer = new StringBuilder(); OutputStream appendable = OutputStream.create(Tools.UTF_8, buffer); appendable.provide(Chunk.create(readable)); assertEquals("HELLO", buffer.toString()); try { readable.ready(); fail(); } catch (IOException expected) { } } }