📜  Java.io.PipedReader类

📅  最后修改于: 2020-11-15 02:49:04             🧑  作者: Mango


介绍

Java.io.PipedReader类是管道输入字符的流。

类声明

以下是Java.io.PipedReader类的声明-

public class PipedReader
   extends Reader

领域

以下是Java.io.PipedReader类的字段-

  • protected Object lock-这是用于同步此流上的操作的对象。

类的构造函数

Sr.No. Constructor & Description
1

PipedReader()

This creates a PipedReader so that it is not yet connected.

2

PipedReader(int pipeSize)

This creates a PipedReader so that it is not yet connected and uses the specified pipe size for the pipe’s buffer.

3

PipedReader(PipedWriter src)

This creates a PipedReader so that it is connected to the piped writer src.

4

PipedReader(PipedWriter src, int pipeSize)

This creates a PipedReader so that it is connected to the piped writer src and uses the specified pipe size for the pipe’s buffer.

类方法

Sr.No. Method & Description
1 void close()

This method closes this piped stream and releases any system resources associated with the stream.

2 void connect(PipedWriter src)

This method causes this piped reader to be connected to the piped writer src.

3 int read()

This method reads the next character of data from this piped stream.

4 int read(char[] cbuf, int off, int len)

This method reads up to len characters of data from this piped stream into an array of characters.

5 boolean ready()

This method tell whether this stream is ready to be read.

方法继承

此类从以下类继承方法-

  • Java.io.Reader
  • Java对象