net.sf.asyncobjects.io
Class BufferedTextChannel

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<C>
      extended by net.sf.asyncobjects.io.WrappingChannel<TextData,ATextInput,ATextOutput,ATextChannel>
          extended by net.sf.asyncobjects.io.BufferedTextChannel
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AChannel<TextData,ATextInput,ATextOutput>, ATextChannel

public class BufferedTextChannel
extends WrappingChannel<TextData,ATextInput,ATextOutput,ATextChannel>
implements ATextChannel

Text 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
BufferedTextChannel(ATextChannel wrapped, int bufferSize)
          A constructor
 
Method Summary
protected  ATextInput wrap(ATextInput input)
          Wrap input into buffered stream
protected  ATextOutput wrap(ATextOutput 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

BufferedTextChannel

public BufferedTextChannel(ATextChannel wrapped,
                           int bufferSize)
A constructor

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

wrap

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

Specified by:
wrap in class WrappingChannel<TextData,ATextInput,ATextOutput,ATextChannel>
Parameters:
input - an input to wrap
Returns:
a buffered stream
See Also:
WrappingChannel.wrap(net.sf.asyncobjects.io.AInput)

wrap

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

Specified by:
wrap in class WrappingChannel<TextData,ATextInput,ATextOutput,ATextChannel>
Parameters:
output - an output
Returns:
wrapped stream
See Also:
WrappingChannel.wrap(net.sf.asyncobjects.io.AOutput)


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