/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
private void next() throws IOException, FHIRException { finished = !reader.ready(); if (!finished) { char[] temp = new char[1]; rule(reader.read(temp, 0, 1) == 1, "unable to read 1 character from the stream"); peeked = temp[0]; } }
private String readSource() throws IOException { StringBuilder s = new StringBuilder(); InputStreamReader r = new InputStreamReader(source,"UTF-8"); while (r.ready()) { s.append((char) r.read()); } r.close(); return s.toString(); }
/** * Thread to accept data from remote host, and pass it to responseHandler */ public void run() { String resp; while(!Thread.interrupted() && !client.isClosed()) { try { if(inStream.ready() && (resp = bufIn.readLine()) != null) { responseMessageHandler.handleResponse(resp + "\n", comm); } } catch (SocketException e) { e.printStackTrace(); return; // terminate thread if disconnected //TODO: at some point, reconnecting should be considered } catch (IOException e) { e.printStackTrace(); return; // terminate thread if disconnected //TODO: at some point, reconnecting should be considered } } }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
/** * Returns if end of the stream was already reached. */ boolean eof() throws IOException { return !in.ready(); }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
@Override public boolean ready() throws IOException { return underlying.ready(); }
/** * @see java.io.Reader#ready() */ public boolean ready() throws IOException { return reader.ready(); }
FileReader fr = new FileReader("somefile"); // ... file reader activity fr.close(); // After closing the reader, the ready() method should cause an IOException: boolean isOpen = true; try { isOpen = fr.ready(); } catch (IOException e) { isOpen = false; } assertFalse("FileReader is still open", isOpen);
FileReader br = new FileReader(file); if(br.ready()) return; else System.exit(1);
try { InputStreamReader reader = new InputStreamReader(System.in); while (!reader.ready()) { Thread.sleep(100); } if (reader.read() > 0) { // interrupt this step and proceed to the next one } } catch (IOException e) { // do something } catch (InterruptedException e) { // noone needs me anymore }
private String readSource() throws IOException { StringBuilder s = new StringBuilder(); InputStreamReader r = new InputStreamReader(source,"UTF-8"); while (r.ready()) { s.append((char) r.read()); } r.close(); return s.toString(); }
InputStreamReader reader = new InputStreamReader( yourInputStream, "windows-1252"); // or what ever seems to be the correct encoding! StringBuilder builder = new StringBuilder(); while (reader.ready()) { builder.append(reader.read()); } reader.close(); String string = builder.toString();
@Override public boolean ready() throws IOException { init(); return internalIn2.ready(); } }
@Override public boolean ready() throws IOException { init(); return internalIn2.ready(); } }