Package org.java_websocket
Interface WrappedByteChannel
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.nio.channels.ByteChannel
,java.nio.channels.Channel
,java.io.Closeable
,java.nio.channels.ReadableByteChannel
,java.nio.channels.WritableByteChannel
- All Known Implementing Classes:
AbstractWrappedByteChannel
,SSLSocketChannel
,SSLSocketChannel2
public interface WrappedByteChannel extends java.nio.channels.ByteChannel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isBlocking()
This function returns the blocking state of the channelboolean
isNeedRead()
returns whether readMore should be called to fetch data which has been decoded but not yet been returned.boolean
isNeedWrite()
returns whether writeMore should be called write additional data.int
readMore(java.nio.ByteBuffer dst)
This function does not read data from the underlying channel at all.void
writeMore()
Gets called whenisNeedWrite()
()} requires a additional rite
-
-
-
Method Detail
-
isNeedWrite
boolean isNeedWrite()
returns whether writeMore should be called write additional data.- Returns:
- is a additional write needed
-
writeMore
void writeMore() throws java.io.IOException
Gets called whenisNeedWrite()
()} requires a additional rite- Throws:
java.io.IOException
- may be thrown due to an error while writing
-
isNeedRead
boolean isNeedRead()
returns whether readMore should be called to fetch data which has been decoded but not yet been returned.- Returns:
- is a additional read needed
- See Also:
ReadableByteChannel.read(ByteBuffer)
,readMore(ByteBuffer)
-
readMore
int readMore(java.nio.ByteBuffer dst) throws java.io.IOException
This function does not read data from the underlying channel at all. It is just a way to fetch data which has already be received or decoded but was but was not yet returned to the user. This could be the case when the decoded data did not fit into the buffer the user passed toReadableByteChannel.read(ByteBuffer)
.- Parameters:
dst
- the destiny of the read- Returns:
- the amount of remaining data
- Throws:
java.io.IOException
- when a error occurred during unwrapping
-
isBlocking
boolean isBlocking()
This function returns the blocking state of the channel- Returns:
- is the channel blocking
-
-