|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gnu.iou.bbuf | +--gnu.iou.bbp
Pipe for `bbo' and `bbi' implements input blocking over `bbuf'.
Usage
bbp pipe = new bbp(); OutputStream pipeOut = new bbo(pipe); InputStream pipeIn = new bbi(pipe);
Thread safety
This class is multi- thread safe only in the standard I/O API
defined here and used by
The mutex locker is accessable via the `getLocker()' method.
bbo
,
bbi
,
dbo
Field Summary | |
protected boolean |
apierrors
|
protected lck |
locker
|
Constructor Summary | |
bbp()
|
|
bbp(boolean api_exc)
|
|
bbp(byte[] buffer)
|
|
bbp(int init)
|
Method Summary | |
void |
close()
Reset reading, writing and "read mark" to the start. |
void |
flush()
Reset reading, writing and "read mark" to the head of the current buffer. |
lck |
getLocker()
|
void |
mark(int readlimit)
Sets "reset" (writing) mark to the current position, ignoring "readlimit" because this is a buffer -- we don't need a buffer size. |
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
Copy into buffer as many as buffer- length bytes, or available bytes. |
void |
reset()
Reset writing back to first byte of the current buffer, or to the last marked position. |
long |
skip(long n)
Skip bytes, or available bytes. |
int |
write(byte[] b)
|
int |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
Methods inherited from class gnu.iou.bbuf |
append, append, append, append, append, append, append, append, available, buf_gf, bufString, cat, copyOutArray, copyOutLoop, debugPrint, destroy, dump, growbuf, length, mark, markedBits, nwrite, print, println, println, println, println, read2, read4, read8, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toString, write2, write4, write8 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final lck locker
protected boolean apierrors
Constructor Detail |
public bbp()
public bbp(boolean api_exc)
api_exc
- If true, throw exceptions on I/O methods that
shouldn't be used on the pipe.public bbp(int init)
public bbp(byte[] buffer)
Method Detail |
public lck getLocker()
public int read()
read
in class bbuf
public int read(byte[] b)
read
in class bbuf
public int read(byte[] b, int off, int len)
bbuf
read
in class bbuf
gnu.iou.bbuf
b
- Non null buffer to copy into.off
- Valid offset in buffer `b' to copy to.len
- Valid number of bytes to copy into `b', usually
`b.length'.public long skip(long n)
bbuf
skip
in class bbuf
gnu.iou.bbuf
n
- Number of bytes to skip.public void mark(int readlimit)
bbuf
mark
in class bbuf
gnu.iou.bbuf
The readlimit argument is ignored because this
is a buffer
public void reset()
bbuf
reset
in class bbuf
public boolean markSupported()
markSupported
in class bbuf
public void write(int b)
write
in class bbuf
gnu.iou.bbuf
b
- Eight bit byte valuepublic int write(byte[] b)
write
in class bbuf
gnu.iou.bbuf
b
- Non null buffer to copy into the internal buffer.public int write(byte[] b, int off, int len)
write
in class bbuf
gnu.iou.bbuf
b
- Non null input buffer to copy into the internal buffer.off
- Offset in input buffer `b' from which to copylen
- Number of bytes to copy from input buffer `b'.public void flush()
bbuf
flush
in class bbuf
public void close()
bbuf
close
in class bbuf
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |