fr.dyade.aaa.util
Class Pipe
public class Pipe
extends java.lang.Object
static int | DFLT_BUF_SIZE
|
static String | DFLT_DIR
|
static String | DFLT_NAME
|
protected Object[] | buffer - The circular buffer into which incoming data is placed.
|
protected RandomAccessFile | fbufin
|
protected long | fbufinptr - The index of the position in the file buffer at which the next piece
of data will be read.
|
protected RandomAccessFile | fbufout
|
protected long | fbufoutptr - The index of the position in the file buffer at which the next piece
of data will be write.
|
protected int | in - 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 String | name
|
protected int | out - 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 int | size
|
Pipe() - Creates a
Pipe with default size for memory buffer.
|
Pipe(int size, String name, String dir) - Creates a
Pipe with specified size for in memory buffer.
|
DFLT_BUF_SIZE
public static final int DFLT_BUF_SIZE
- 50
DFLT_DIR
public static final String DFLT_DIR
DFLT_NAME
public static final String DFLT_NAME
buffer
protected Object[] buffer
The circular buffer into which incoming data is placed.
fbufin
protected RandomAccessFile fbufin
fbufinptr
protected long fbufinptr
The index of the position in the file buffer at which the next piece
of data will be read.
fbufout
protected RandomAccessFile fbufout
fbufoutptr
protected long fbufoutptr
The index of the position in the file buffer at which the next piece
of data will be write. in<0
implies the buffer is empty.
in
protected int in
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. in<0
implies the buffer is empty,
in==out
implies the buffer is full
name
protected String name
out
protected int out
The index of the position in the circular buffer at which the next
byte of data will be read by this piped input stream.
Pipe
public Pipe()
throws IOException
Creates a Pipe
with default size for memory buffer.
Pipe
public Pipe(int size,
String name,
String dir)
throws IOException
Creates a Pipe
with specified size for in memory buffer.
size
- the size for in memory buffer.
getBufferSize
public final int getBufferSize()
getSizeInFile
public final int getSizeInFile()
read
public int read(Object[] buf)
throws IOException
write
public void write(byte[] msg)
throws IOException
Copyright B) 2004 Scalagent - All rights reserved