- Java.io - Writer
- Java.io - StringWriter
- Java.io - StringReader
- Java.io - StringBufferInputStream
- Java.io - StreamTokenizer
- Java.io - SerializablePermission
- Java.io - SequenceInputStream
- Java.io - Reader
- Java.io - RandomAccessFile
- Java.io - PushbackReader
- Java.io - PushbackInputStream
- Java.io - PrintWriter
- Java.io - PrintStream
- Java.io - PipedWriter
- Java.io - PipedReader
- Java.io - PipedOutputStream
- Java.io - PipedInputStream
- Java.io - OutputStreamWriter
- Java.io - OutputStream
- Java.io - ObjectStreamField
- Java.io - ObjectStreamClass
- io - ObjectOutputStream.PutField
- Java.io - ObjectOutputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectInputStream
- Java.io - LineNumberReader
- Java.io - LineNumberInputStream
- Java.io - InputStreamReader
- Java.io - InputStream
- Java.io - FilterWriter
- Java.io - FilterReader
- Java.io - FilterOutputStream
- Java.io - FilterInputStream
- Java.io - FileWriter
- Java.io - FileReader
- Java.io - FilePermission
- Java.io - FileOutputStream
- Java.io - FileInputStream
- Java.io - FileDescriptor
- Java.io - File
- Java.io - DataOutputStream
- Java.io - DataInputStream
- Java.io - Console
- Java.io - CharArrayWriter
- Java.io - CharArrayReader
- Java.io - ByteArrayOutputStream
- Java.io - ByteArrayInputStream
- Java.io - BufferedWriter
- Java.io - BufferedReader
- Java.io - BufferedOutputStream
- Java.io - BufferedInputStream
- Java.io - Home
Java.io package extras
Java.io package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.io.PipedInputStream Class
Introduction
The Java.io.PipedInputStream class is a piped input stream that can be connected to a piped output stream, the piped input stream then provides whatever data bytes are written to the piped output stream.Following are the important points about PipedInputStream −
The piped input stream contains a buffer, decouppng read operations from write operations, within pmits.
Attempting to use both objects from a single thread is not recommended, as it may deadlock the thread.
A pipe is said to be broken if a thread that was providing data bytes to the connected piped output stream is no longer apve.
Class declaration
Following is the declaration for Java.io.PipedInputStream class −
pubpc class PipedInputStream extends InputStream
Field
Following are the fields for Java.io.PipedInputStream class −
protected byte[] buffer − This is the circular buffer into which incoming data is placed.
protected int in − This is the index of the position in the circular buffer at which the next byte of data will be stored when received from the connected piped output stream.
protected int out − This is the index of the position in the circular buffer at which the next byte of data will be read by this piped input stream.
protected static int PIPE_SIZE − This is the default size of the pipe s circular input buffer.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | PipedInputStream() This creates a PipedInputStream so that it is not yet connected. |
2 | PipedInputStream(int pipeSize) This creates a PipedInputStream so that it is not yet connected and uses the specified pipe size for the pipe s buffer. |
3 | PipedInputStream(PipedOutputStream src) This creates a PipedInputStream so that it is connected to the piped output stream src. |
4 | PipedInputStream(PipedOutputStream src, int pipeSize) This creates a PipedInputStream so that it is connected to the piped output stream src and uses the specified pipe size for the pipe s buffer. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method returns the number of bytes that can be read from this input stream without blocking. |
2 | This method closes this piped input stream and releases any system resources associated with the stream. |
3 | This method causes this piped input stream to be connected to the piped output stream src. |
4 | This method reads the next byte of data from this piped input stream. |
5 | This method reads up to len bytes of data from this piped input stream into an array of bytes. |
6 | This method receives a byte of data. |
Methods inherited
This class inherits methods from the following classes −
Java.io.InputStream
Java.io.Object