Package com.sun.xml.ws.transport.tcp.io
Class FramedMessageInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.sun.xml.ws.transport.tcp.io.FramedMessageInputStream
-
- All Implemented Interfaces:
LifeCycle,Closeable,AutoCloseable
public final class FramedMessageInputStream extends InputStream implements LifeCycle
Stream wrapper around aByteBuffer
-
-
Constructor Summary
Constructors Constructor Description FramedMessageInputStream()FramedMessageInputStream(int frameSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()intavailable()Return the available bytesvoidclose()Close this stream.voidforceHeaderRead()intgetChannelId()intgetContentId()Map<Integer,String>getContentProperties()intgetMessageId()booleanisDirectMode()booleanisMessageInProcess()booleanmarkSupported()Return true if mark is supported.voidpassivate()intread()Read the first byte from the wrappedByteBuffer.intread(byte[] b)Read the bytes from the wrappedByteBuffer.intread(byte[] b, int offset, int length)Read the first byte of the wrappedByteBuffer.voidreset()voidsetByteBuffer(ByteBuffer byteBuffer)voidsetDirectMode(boolean isDirectMode)voidsetFrameSize(int frameSize)voidsetSocketChannel(SocketChannel socketChannel)voidskipToEndOfMessage()StringtoString()-
Methods inherited from class java.io.InputStream
mark, nullInputStream, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Method Detail
-
setSocketChannel
public void setSocketChannel(SocketChannel socketChannel)
-
getChannelId
public int getChannelId()
-
getMessageId
public int getMessageId()
-
getContentId
public int getContentId()
-
isDirectMode
public boolean isDirectMode()
-
setDirectMode
public void setDirectMode(boolean isDirectMode)
-
setFrameSize
public void setFrameSize(int frameSize)
-
setByteBuffer
public void setByteBuffer(ByteBuffer byteBuffer)
-
available
public int available()
Return the available bytes- Overrides:
availablein classInputStream- Returns:
- the wrapped byteBuffer.remaining()
-
close
public void close()
Close this stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
-
markSupported
public boolean markSupported()
Return true if mark is supported.- Overrides:
markSupportedin classInputStream
-
read
public int read()
Read the first byte from the wrappedByteBuffer.- Specified by:
readin classInputStream
-
read
public int read(byte[] b)
Read the bytes from the wrappedByteBuffer.- Overrides:
readin classInputStream
-
read
public int read(byte[] b, int offset, int length)Read the first byte of the wrappedByteBuffer.- Overrides:
readin classInputStream
-
forceHeaderRead
public void forceHeaderRead() throws IOException- Throws:
IOException
-
skipToEndOfMessage
public void skipToEndOfMessage() throws EOFException- Throws:
EOFException
-
isMessageInProcess
public boolean isMessageInProcess()
-
reset
public void reset()
- Overrides:
resetin classInputStream
-
-