public interface Pipe
extends java.io.Closeable
read(byte[], int, int) produces exactly the bytes that were previously written.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases any resources allocated for this pipe.
|
boolean |
isEmpty() |
boolean |
isFull() |
int |
read(byte[] buf)
Reads at most buf
.length bytes from this pipe into the buf. |
int |
read(byte[] buf,
int off,
int len)
Reads at most len bytes from this pipe into the buf at offset off.
|
int |
write(byte[] buf)
Writes at most buf
.length bytes from buf to this pipe. |
int |
write(byte[] buf,
int off,
int len)
Writes at most len bytes from buf at offset off to this pipe.
|
int read(byte[] buf) throws java.io.IOException
.length bytes from this pipe into the buf.1 ... buf.length); 0 iff this pipe is emptyjava.io.IOExceptionint read(byte[] buf,
int off,
int len)
throws java.io.IOException
1 ... len); 0 iff this pipe is emptyjava.lang.RuntimeException - off is negativejava.lang.RuntimeException - len is negativejava.lang.RuntimeException - off+len is greater than buf.lengthjava.io.IOExceptionint write(byte[] buf) throws java.io.IOException
.length bytes from buf to this pipe.1 ... buf.length); 0 iff this pipe is fulljava.io.IOExceptionint write(byte[] buf,
int off,
int len)
throws java.io.IOException
1 ... len); 0 iff this pipe is fulljava.lang.RuntimeException - off is negativejava.lang.RuntimeException - len is negativejava.lang.RuntimeException - off+len is greater than buf.lengthjava.io.IOExceptionvoid close()
throws java.io.IOException
read(byte[],
int, int) and write(byte[], int, int) are undefined.close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionboolean isFull()
write(byte[], int, int) will return 0boolean isEmpty()
read(byte[], int, int) will return 0