public class ReaderInputStream extends InputStream
该流是字符流回到字节流的桥梁 使用缓冲区缓存当前读取的字符转化的字节 不可获取长度
InputStream
,
Reader
,
InputStreamReader
Constructor and Description |
---|
ReaderInputStream(CharSequence reader) |
ReaderInputStream(File file) |
ReaderInputStream(Reader reader) |
Modifier and Type | Method and Description |
---|---|
int |
available()
获取当前流的可读长度.
|
void |
close() |
protected void |
finalize() |
void |
mark(int readlimit) |
int |
read() |
void |
reset() |
markSupported, read, read, skip
protected Reader reader
包装的字符流.
public ReaderInputStream(Reader reader)
public ReaderInputStream(CharSequence reader)
public ReaderInputStream(File file) throws FileNotFoundException
FileNotFoundException
protected void finalize() throws Throwable
public int read() throws IOException
read
in class InputStream
IOException
public void reset() throws IOException
reset
in class InputStream
IOException
public void mark(int readlimit)
mark
in class InputStream
public int available() throws IOException
获取当前流的可读长度.
available
in class InputStream
IOException
- 一定无法获取public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2019. All rights reserved.