org.glassfish.grizzly.streams
Class BufferedInput

java.lang.Object
  extended by org.glassfish.grizzly.streams.BufferedInput
All Implemented Interfaces:
Input
Direct Known Subclasses:
DefaultStreamReader.Input, TransformerInput

public abstract class BufferedInput
extends java.lang.Object
implements Input

Author:
Alexey Stashok

Field Summary
protected  CompletionHandler<java.lang.Integer> completionHandler
           
protected  CompositeBuffer compositeBuffer
           
protected  Condition condition
           
protected  FutureImpl<java.lang.Integer> future
           
protected  boolean isCompletionHandlerRegistered
           
protected  java.util.concurrent.locks.ReentrantReadWriteLock lock
           
protected  java.lang.Exception registrationStackTrace
           
 
Constructor Summary
BufferedInput()
           
 
Method Summary
 boolean append(Buffer buffer)
           
 void close()
           
 Buffer getBuffer()
          Return the Input's Buffer.
 boolean isBuffered()
           
protected  void notifyCompleted(CompletionHandler<java.lang.Integer> completionHandler)
           
 GrizzlyFuture<java.lang.Integer> notifyCondition(Condition condition, CompletionHandler<java.lang.Integer> completionHandler)
           
protected  void notifyFailure(CompletionHandler<java.lang.Integer> completionHandler, java.lang.Throwable failure)
           
protected abstract  void onCloseInputSource()
           
protected abstract  void onOpenInputSource()
           
 boolean prepend(Buffer buffer)
           
 byte read()
           
 int size()
           
 void skip(int length)
           
 Buffer takeBuffer()
          Takes the Input's Buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compositeBuffer

protected final CompositeBuffer compositeBuffer

lock

protected final java.util.concurrent.locks.ReentrantReadWriteLock lock

isCompletionHandlerRegistered

protected boolean isCompletionHandlerRegistered

registrationStackTrace

protected java.lang.Exception registrationStackTrace

condition

protected Condition condition

completionHandler

protected CompletionHandler<java.lang.Integer> completionHandler

future

protected FutureImpl<java.lang.Integer> future
Constructor Detail

BufferedInput

public BufferedInput()
Method Detail

onOpenInputSource

protected abstract void onOpenInputSource()
                                   throws java.io.IOException
Throws:
java.io.IOException

onCloseInputSource

protected abstract void onCloseInputSource()
                                    throws java.io.IOException
Throws:
java.io.IOException

append

public boolean append(Buffer buffer)

prepend

public boolean prepend(Buffer buffer)

read

public byte read()
          throws java.io.IOException
Specified by:
read in interface Input
Throws:
java.io.IOException

skip

public void skip(int length)
Specified by:
skip in interface Input

isBuffered

public final boolean isBuffered()
Specified by:
isBuffered in interface Input

getBuffer

public Buffer getBuffer()
Description copied from interface: Input
Return the Input's Buffer.

Specified by:
getBuffer in interface Input
Returns:
the Input's Buffer.

takeBuffer

public Buffer takeBuffer()
Description copied from interface: Input
Takes the Input's Buffer. This Input should never try to access this Buffer.

Specified by:
takeBuffer in interface Input
Returns:
the Input's Buffer. This Input should never try to access this Buffer.

size

public int size()
Specified by:
size in interface Input

close

public void close()
Specified by:
close in interface Input

notifyCondition

public GrizzlyFuture<java.lang.Integer> notifyCondition(Condition condition,
                                                        CompletionHandler<java.lang.Integer> completionHandler)
Specified by:
notifyCondition in interface Input

notifyCompleted

protected void notifyCompleted(CompletionHandler<java.lang.Integer> completionHandler)

notifyFailure

protected void notifyFailure(CompletionHandler<java.lang.Integer> completionHandler,
                             java.lang.Throwable failure)


Copyright © 2012 Oracle Corporation. All Rights Reserved.