Class RawInputHandler

  • All Implemented Interfaces:
    ProtocolInputHandler

    public class RawInputHandler
    extends java.lang.Object
    implements ProtocolInputHandler
    A RawInputHandler handles a raw byte stream and pass them to a chunk listener on every call to put().
    Author:
    IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
    • Constructor Summary

      Constructors 
      Constructor Description
      RawInputHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ProtocolInputHandler create()
      Factory method to create a new ProtocolInputHandler.
      void createInputBuffer​(int initialSize, int ensureSize)
      Create the input buffer of the protocol handler.
      byte[] getBuffer()
      Returns the protocol handler input buffer.
      java.nio.ByteBuffer getByteBuffer()
      Returns the protocol handler input buffer.
      int getOffset()
      Returns the current offset of the input buffer.
      void setBytesWritten​(int written)
      Set the number of bytes written into the buffer.
      void setChunkListener​(ChunkListener listener)
      Set the ChunkListener.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RawInputHandler

        public RawInputHandler()
    • Method Detail

      • createInputBuffer

        public void createInputBuffer​(int initialSize,
                                      int ensureSize)
        Description copied from interface: ProtocolInputHandler
        Create the input buffer of the protocol handler. The buffer must be created with the initialSize. Each time getBuffer() is called, the buffer must have a remaining size of ensureSize.
        Specified by:
        createInputBuffer in interface ProtocolInputHandler
        Parameters:
        initialSize - initial size
        ensureSize - ensured size on each getBuffer call
      • setBytesWritten

        public void setBytesWritten​(int written)
        Description copied from interface: ProtocolInputHandler
        Set the number of bytes written into the buffer. Called from the Network Swiftlet after it has read bytes from sockets directly into the buffer+offset.
        Specified by:
        setBytesWritten in interface ProtocolInputHandler
        Parameters:
        written - number of bytes written
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object