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 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, ByteBuffer writeMe, boolean writeSize, Continuation<ByteBuffer,Exception> c)
           
BufferReaderWriter(P2PSocket<Identifier> sock, ByteBuffer writeMe, boolean writeSize, Continuation<ByteBuffer,Exception> c, int readSize)
           
 
Method Summary
 void done(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,
                          ByteBuffer writeMe,
                          boolean writeSize,
                          Continuation<ByteBuffer,Exception> c)

BufferReaderWriter

public BufferReaderWriter(P2PSocket<Identifier> sock,
                          ByteBuffer writeMe,
                          boolean writeSize,
                          Continuation<ByteBuffer,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(Exception e)


Copyright © 2010. All Rights Reserved.