/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
public int read(char[] buffer, int offset, int count) throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed");
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Reads a single character from this reader and returns it as an integer * with the two higher-order bytes set to 0. Returns -1 if the end of the * reader has been reached. The byte value is either obtained from * converting bytes in this reader's buffer or by first filling the buffer * from the source InputStream and then reading from the buffer. * * @return the character read or -1 if the end of the reader has been * reached. * @throws IOException * if this reader is closed or some other I/O error occurs. */ @Override public int read() throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed"); } char[] buf = new char[1]; return read(buf, 0, 1) != -1 ? buf[0] : -1; } }
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
/** * Returns the canonical name of the encoding used by this writer to convert characters to * bytes, or null if this writer has been closed. Most callers should probably keep * track of the String or Charset they passed in; this method may not return the same * name. */ public String getEncoding() { if (!isOpen()) { return null; } return decoder.charset().name(); }
public int read(char[] buffer, int offset, int count) throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed");
public int read(char[] buffer, int offset, int count) throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed");
public int read(char[] buffer, int offset, int count) throws IOException { synchronized (lock) { if (!isOpen()) { throw new IOException("InputStreamReader is closed");