本文整理了Java中java.io.InputStreamReader.isOpen()
方法的一些代码示例,展示了InputStreamReader.isOpen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。InputStreamReader.isOpen()
方法的具体详情如下:
包路径:java.io.InputStreamReader
类名称:InputStreamReader
方法名:isOpen
暂无
代码示例来源:origin: robovm/robovm
/**
* 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();
}
代码示例来源:origin: robovm/robovm
/**
* 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;
}
}
代码示例来源:origin: robovm/robovm
public int read(char[] buffer, int offset, int count) throws IOException {
synchronized (lock) {
if (!isOpen()) {
throw new IOException("InputStreamReader is closed");
代码示例来源:origin: MobiVM/robovm
/**
* 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();
}
代码示例来源:origin: MobiVM/robovm
/**
* 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;
}
}
代码示例来源:origin: ibinti/bugvm
/**
* 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();
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* 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;
}
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* 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;
}
}
代码示例来源:origin: ibinti/bugvm
/**
* 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;
}
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* 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();
}
代码示例来源:origin: com.jtransc/jtransc-rt
/**
* 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();
}
代码示例来源:origin: com.jtransc/jtransc-rt
/**
* 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;
}
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* 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;
}
}
代码示例来源:origin: FlexoVM/flexovm
/**
* 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;
}
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* 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();
}
代码示例来源:origin: FlexoVM/flexovm
/**
* 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();
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* 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();
}
代码示例来源:origin: com.jtransc/jtransc-rt
public int read(char[] buffer, int offset, int count) throws IOException {
synchronized (lock) {
if (!isOpen()) {
throw new IOException("InputStreamReader is closed");
代码示例来源:origin: MobiVM/robovm
public int read(char[] buffer, int offset, int count) throws IOException {
synchronized (lock) {
if (!isOpen()) {
throw new IOException("InputStreamReader is closed");
代码示例来源:origin: ibinti/bugvm
public int read(char[] buffer, int offset, int count) throws IOException {
synchronized (lock) {
if (!isOpen()) {
throw new IOException("InputStreamReader is closed");
内容来源于网络,如有侵权,请联系作者删除!