net.sf.asyncobjects.io
Class BufferedByteChannel

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<C>
      extended by net.sf.asyncobjects.io.WrappingChannel<BinaryData,AByteInput,AByteOutput,AByteChannel>
          extended by net.sf.asyncobjects.io.BufferedByteChannel
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AByteChannel, AChannel<BinaryData,AByteInput,AByteOutput>

public class BufferedByteChannel
extends WrappingChannel<BinaryData,AByteInput,AByteOutput,AByteChannel>
implements AByteChannel

Byte channel that wraps existing channel and adds buffering functionality over it.

Author:
const

Field Summary
protected  int bufferSize
          a buffer size
 
Fields inherited from class net.sf.asyncobjects.io.WrappingChannel
in, out, wrapped
 
Constructor Summary
BufferedByteChannel(AByteChannel wrapped, int bufferSize)
          A constructor
 
Method Summary
protected  AByteInput wrap(AByteInput input)
          Wrap input into buffered stream
protected  AByteOutput wrap(AByteOutput output)
          Wrap output into buffered stream
 
Methods inherited from class net.sf.asyncobjects.io.WrappingChannel
close, getInput, getOutput
 
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer
dereference, export, isImmediate, myVat, promise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.asyncobjects.io.AChannel
getInput, getOutput
 
Methods inherited from interface net.sf.asyncobjects.ACloseable
close
 
Methods inherited from interface net.sf.asyncobjects.AsyncObject
dereference, isImmediate
 

Field Detail

bufferSize

protected final int bufferSize
a buffer size

Constructor Detail

BufferedByteChannel

public BufferedByteChannel(AByteChannel wrapped,
                           int bufferSize)
A constructor

Parameters:
wrapped - a wrapped channel
bufferSize - a buffer size for streams
Method Detail

wrap

protected AByteInput wrap(AByteInput input)
Wrap input into buffered stream

Specified by:
wrap in class WrappingChannel<BinaryData,AByteInput,AByteOutput,AByteChannel>
Parameters:
input - an input to wrap
Returns:
a buffered stream
See Also:
WrappingChannel.wrap(net.sf.asyncobjects.io.AInput)

wrap

protected AByteOutput wrap(AByteOutput output)
Wrap output into buffered stream

Specified by:
wrap in class WrappingChannel<BinaryData,AByteInput,AByteOutput,AByteChannel>
Parameters:
output - an output
Returns:
wrapped stream
See Also:
WrappingChannel.wrap(net.sf.asyncobjects.io.AOutput)


Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.