public class ReaderInputStream extends InputStream
| Constructor and Description |
|---|
ReaderInputStream(Reader reader,
Charset charset)
构造,使用指定的字符集和默认缓冲区大小
|
ReaderInputStream(Reader reader,
CharsetEncoder encoder)
构造,使用默认的缓冲区大小
|
ReaderInputStream(Reader reader,
CharsetEncoder encoder,
int bufferSize)
构造,允许指定缓冲区大小。
|
ReaderInputStream(Reader reader,
Charset charset,
int bufferSize)
构造,使用指定的字符集和缓冲区大小
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
available, mark, markSupported, read, reset, skippublic ReaderInputStream(Reader reader, Charset charset)
reader - 提供字符数据的Readercharset - 字符集,用于创建CharsetEncoderpublic ReaderInputStream(Reader reader, Charset charset, int bufferSize)
reader - 提供字符数据的Readercharset - 字符集,用于创建CharsetEncoderbufferSize - 缓冲区大小public ReaderInputStream(Reader reader, CharsetEncoder encoder)
reader - 提供字符数据的Readerencoder - 用于编码的CharsetEncoderpublic ReaderInputStream(Reader reader, CharsetEncoder encoder, int bufferSize)
reader - 提供字符数据的Readerencoder - 用于编码的CharsetEncoderbufferSize - 缓冲区大小public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionCopyright © 2025. All rights reserved.