com.sun.xml.ws.transport.tcp.io
Class FramedMessageInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.sun.xml.ws.transport.tcp.io.FramedMessageInputStream
All Implemented Interfaces:
LifeCycle, java.io.Closeable

public final class FramedMessageInputStream
extends java.io.InputStream
implements LifeCycle

Stream wrapper around a ByteBuffer


Constructor Summary
FramedMessageInputStream()
           
FramedMessageInputStream(int frameSize)
           
 
Method Summary
 void activate()
           
 int available()
          Return the available bytes
 void close()
          Close this stream.
 void forceHeaderRead()
           
 int getChannelId()
           
 int getContentId()
           
 java.util.Map<java.lang.Integer,java.lang.String> getContentProperties()
           
 int getMessageId()
           
 boolean isDirectMode()
           
 boolean isMessageInProcess()
           
 boolean markSupported()
          Return true if mark is supported.
 void passivate()
           
 int read()
          Read the first byte from the wrapped ByteBuffer.
 int read(byte[] b)
          Read the bytes from the wrapped ByteBuffer.
 int read(byte[] b, int offset, int length)
          Read the first byte of the wrapped ByteBuffer.
 void reset()
           
 void setByteBuffer(java.nio.ByteBuffer byteBuffer)
           
 void setDirectMode(boolean isDirectMode)
           
 void setFrameSize(int frameSize)
           
 void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
           
 void skipToEndOfMessage()
           
 java.lang.String toString()
           
 
Methods inherited from class java.io.InputStream
mark, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FramedMessageInputStream

public FramedMessageInputStream()

FramedMessageInputStream

public FramedMessageInputStream(int frameSize)
Method Detail

setSocketChannel

public void setSocketChannel(java.nio.channels.SocketChannel socketChannel)

getChannelId

public int getChannelId()

getMessageId

public int getMessageId()

getContentId

public int getContentId()

getContentProperties

public java.util.Map<java.lang.Integer,java.lang.String> getContentProperties()

isDirectMode

public boolean isDirectMode()

setDirectMode

public void setDirectMode(boolean isDirectMode)

setFrameSize

public void setFrameSize(int frameSize)

setByteBuffer

public void setByteBuffer(java.nio.ByteBuffer byteBuffer)

available

public int available()
Return the available bytes

Overrides:
available in class java.io.InputStream
Returns:
the wrapped byteBuffer.remaining()

close

public void close()
Close this stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream

markSupported

public boolean markSupported()
Return true if mark is supported.

Overrides:
markSupported in class java.io.InputStream

read

public int read()
Read the first byte from the wrapped ByteBuffer.

Specified by:
read in class java.io.InputStream

read

public int read(byte[] b)
Read the bytes from the wrapped ByteBuffer.

Overrides:
read in class java.io.InputStream

read

public int read(byte[] b,
                int offset,
                int length)
Read the first byte of the wrapped ByteBuffer.

Overrides:
read in class java.io.InputStream

forceHeaderRead

public void forceHeaderRead()
                     throws java.io.IOException
Throws:
java.io.IOException

skipToEndOfMessage

public void skipToEndOfMessage()
                        throws java.io.EOFException
Throws:
java.io.EOFException

isMessageInProcess

public boolean isMessageInProcess()

reset

public void reset()
Overrides:
reset in class java.io.InputStream

activate

public void activate()
Specified by:
activate in interface LifeCycle

passivate

public void passivate()
Specified by:
passivate in interface LifeCycle

toString

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