Rice Pastry API

org.mpisws.p2p.transport.util
Class BufferReaderWriter<Identifier>

java.lang.Object
  extended by org.mpisws.p2p.transport.util.BufferReaderWriter<Identifier>

public class BufferReaderWriter<Identifier>
extends java.lang.Object

Concurrently reads a buffer and writes a buffer at the same time, then calls the continuation when done.

Author:
Jeff Hoye

Constructor Summary
BufferReaderWriter(P2PSocket<Identifier> sock, java.nio.ByteBuffer writeMe, boolean writeSize, Continuation<java.nio.ByteBuffer,java.lang.Exception> c)
           
BufferReaderWriter(P2PSocket<Identifier> sock, java.nio.ByteBuffer writeMe, boolean writeSize, Continuation<java.nio.ByteBuffer,java.lang.Exception> c, int readSize)
           
 
Method Summary
 void done(java.lang.Exception e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferReaderWriter

public BufferReaderWriter(P2PSocket<Identifier> sock,
                          java.nio.ByteBuffer writeMe,
                          boolean writeSize,
                          Continuation<java.nio.ByteBuffer,java.lang.Exception> c)

BufferReaderWriter

public BufferReaderWriter(P2PSocket<Identifier> sock,
                          java.nio.ByteBuffer writeMe,
                          boolean writeSize,
                          Continuation<java.nio.ByteBuffer,java.lang.Exception> c,
                          int readSize)
Parameters:
sock - the socket to read/write from/to
writeMe - the bytes to write
writeSize - true if I should write a size header before the buffer, false if it's fixed size
c - the continuation to notify
readSize - the size of the buffer to read, -1 if it should read a size header first
Method Detail

done

public void done(java.lang.Exception e)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection