fr.dyade.aaa.util

Class Pipe


public class Pipe
extends java.lang.Object

Field Summary

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

Constructor Summary

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.

Method Summary

int
getBufferSize()
int
getSizeInFile()
int
read(Object[] buf)
void
write(byte[] msg)

Field Details

DFLT_BUF_SIZE

public static final int DFLT_BUF_SIZE

Field Value:
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.


size

protected int size

Constructor Details

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.

Parameters:
size - the size for in memory buffer.

Method Details

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