fr.dyade.aaa.util
Class Pipe

java.lang.Object
  extended byfr.dyade.aaa.util.Pipe

public class Pipe
extends java.lang.Object


Field Summary
protected  java.lang.Object[] buffer
          The circular buffer into which incoming data is placed.
static int DFLT_BUF_SIZE
           
static java.lang.String DFLT_DIR
           
static java.lang.String DFLT_NAME
           
protected  java.io.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  java.io.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  java.lang.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, java.lang.String name, java.lang.String dir)
          Creates a Pipe with specified size for in memory buffer.
 
Method Summary
 int getBufferSize()
           
 int getSizeInFile()
           
 int read(java.lang.Object[] buf)
           
 void write(byte[] msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

size

protected int size

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


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.


DFLT_BUF_SIZE

public static final int DFLT_BUF_SIZE
See Also:
Constant Field Values

DFLT_NAME

public static final java.lang.String DFLT_NAME
See Also:
Constant Field Values

DFLT_DIR

public static final java.lang.String DFLT_DIR

buffer

protected java.lang.Object[] buffer
The circular buffer into which incoming data is placed.


fbufinptr

protected long fbufinptr
The index of the position in the file buffer at which the next piece of data will be read.


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.


fbufin

protected java.io.RandomAccessFile fbufin

fbufout

protected java.io.RandomAccessFile fbufout
Constructor Detail

Pipe

public Pipe()
     throws java.io.IOException
Creates a Pipe with default size for memory buffer.


Pipe

public Pipe(int size,
            java.lang.String name,
            java.lang.String dir)
     throws java.io.IOException
Creates a Pipe with specified size for in memory buffer.

Parameters:
size - the size for in memory buffer.
Method Detail

getBufferSize

public final int getBufferSize()

getSizeInFile

public final int getSizeInFile()

write

public void write(byte[] msg)
           throws java.io.IOException
Throws:
java.io.IOException

read

public int read(java.lang.Object[] buf)
         throws java.io.IOException
Throws:
java.io.IOException


Copyright ? 2004 Scalagent - All rights reserved