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, skip
public 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 InputStream
IOException
public int read() throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2025. All rights reserved.