/** * Reads from the <CODE>Reader</CODE>, returning the same value. * * @return the value of the next character in the <CODE>Reader</CODE>. * * @exception IOException if the original <code>Reader</code> fails to be read */ public synchronized int read() throws IOException { if (in == null) { throw new IOException("Stream Closed"); } byte result; if (slack != null && begin < slack.length) { result = slack[begin]; if (++begin == slack.length) { slack = null; } } else { byte[] buf = new byte[1]; if (read(buf, 0, 1) <= 0) { result = -1; } result = buf[0]; } if (result < -1) { result += 256; } return result; }
/** * Reads from the <CODE>Reader</CODE>, returning the same value. * * @return the value of the next character in the <CODE>Reader</CODE>. * * @exception IOException if the original <code>Reader</code> fails to be read */ public synchronized int read() throws IOException { if (in == null) { throw new IOException("Stream Closed"); } byte result; if (slack != null && begin < slack.length) { result = slack[begin]; if (++begin == slack.length) { slack = null; } } else { byte[] buf = new byte[1]; if (read(buf, 0, 1) <= 0) { result = -1; } result = buf[0]; } if (result < -1) { result += 256; } return result; }
/** * Reads from the <CODE>Reader</CODE>, returning the same value. * * @return the value of the next character in the <CODE>Reader</CODE>. * * @exception IOException if the original <code>Reader</code> fails to be read */ public synchronized int read() throws IOException { if (in == null) { throw new IOException("Stream Closed"); } byte result; if (slack != null && begin < slack.length) { result = slack[begin]; if (++begin == slack.length) { slack = null; } } else { byte[] buf = new byte[1]; if (read(buf, 0, 1) <= 0) { result = -1; } result = buf[0]; } if (result < -1) { result += 256; } return result; }
/** * Reads from the <CODE>Reader</CODE>, returning the same value. * * @return the value of the next character in the <CODE>Reader</CODE>. * * @exception IOException if the original <code>Reader</code> fails to be read */ public synchronized int read() throws IOException { if (in == null) { throw new IOException("Stream Closed"); } byte result; if (slack != null && begin < slack.length) { result = slack[begin]; if (++begin == slack.length) { slack = null; } } else { byte[] buf = new byte[1]; if (read(buf, 0, 1) <= 0) { result = -1; } result = buf[0]; } if (result < -1) { result += 256; } return result; }
/** * Reads from the <CODE>Reader</CODE>, returning the same value. * * @return the value of the next character in the <CODE>Reader</CODE>. * * @exception IOException if the original <code>Reader</code> fails to be read */ public synchronized int read() throws IOException { if (in == null) { throw new IOException("Stream Closed"); } byte result; if (slack != null && begin < slack.length) { result = slack[begin]; if (++begin == slack.length) { slack = null; } } else { byte[] buf = new byte[1]; if (read(buf, 0, 1) <= 0) { result = -1; } result = buf[0]; } if (result < -1) { result += 256; } return result; }