public interface Pipe extends 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 IOException
.length
bytes from this pipe into the buf.1 ...
buf.length
); 0 iff this pipe is emptyIOException
int read(byte[] buf, int off, int len) throws IOException
1 ... len
); 0 iff this pipe is emptyRuntimeException
- off is negativeRuntimeException
- len is negativeRuntimeException
- off+len is greater than buf.length
IOException
int write(byte[] buf) throws IOException
.length
bytes from buf to this pipe.1 ...
buf.length
); 0 iff this pipe is fullIOException
int write(byte[] buf, int off, int len) throws IOException
1 ... len
); 0 iff this pipe is fullRuntimeException
- off is negativeRuntimeException
- len is negativeRuntimeException
- off+len is greater than buf.length
IOException
void close() throws IOException
read(byte[],
int, int)
and write(byte[], int, int)
are undefined.close
in interface AutoCloseable
close
in interface Closeable
IOException
boolean isFull()
write(byte[], int, int)
will return 0boolean isEmpty()
read(byte[], int, int)
will return 0Copyright © 2018 Arno Unkrig. All rights reserved.