com.stepsoncats.gublists
Class ByteArrayPipe

java.lang.Object
  |
  +--com.stepsoncats.gublists.FlexPipe
        |
        +--com.stepsoncats.gublists.ByteArrayPipe

public class ByteArrayPipe
extends FlexPipe

A ByteArrayPipe is a FlexPipe designed for sending byte arrays between threads.


Constructor Summary
ByteArrayPipe()
           
 
Method Summary
 byte[] poll()
          Read an array of bytes sent by some other thread via this FlexPipe, if any.
 byte[] read()
          Read an array of bytes sent by some other thread via this FlexPipe.
 void write(byte[] byteArray)
          Send an arbitrary array of bytes to another thread via this FlexPipe.
 
Methods inherited from class com.stepsoncats.gublists.FlexPipe
attach, detach, pollForItem, readItem, writeItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayPipe

public ByteArrayPipe()
Method Detail

write

public void write(byte[] byteArray)
Send an arbitrary array of bytes to another thread via this FlexPipe.
Parameters:
byteArray - The array of bytes to send.

read

public byte[] read()
            throws java.lang.InterruptedException
Read an array of bytes sent by some other thread via this FlexPipe. The method blocks until there is at least one byte array in the pipe.
Returns:
The array of bytes that was sent.

poll

public byte[] poll()
            throws java.lang.InterruptedException
Read an array of bytes sent by some other thread via this FlexPipe, if any. The method immediately returns null if the pipe is empty.
Returns:
The array of bytes that was sent.


Copyright 2003 Steps On Cats