Package java.io

Examples of java.io.StringReader.ready()


    "bouncers.\n";

  StringReader sr = new StringReader(str);
  harness.check(true, "StringReader(String)");
  try {    // 1.2 API adds this exception, not in 1.1
    harness.check(sr.ready(), "ready()");
  }
  catch (IOException e) {
  harness.fail("Unexpected IOException on ready()");
  }
  harness.check(sr.markSupported(), "markSupported()");
View Full Code Here


    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) {
    }
  }
View Full Code Here

        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();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.