Package org.apache.tomcat.util.net
Class NioChannel.ClosedNioChannel
- java.lang.Object
-
- org.apache.tomcat.util.net.NioChannel
-
- org.apache.tomcat.util.net.NioChannel.ClosedNioChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.GatheringByteChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.ScatteringByteChannel,java.nio.channels.WritableByteChannel
- Enclosing class:
- NioChannel
public static class NioChannel.ClosedNioChannel extends NioChannel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tomcat.util.net.NioChannel
NioChannel.ClosedNioChannel
-
-
Field Summary
-
Fields inherited from class org.apache.tomcat.util.net.NioChannel
bufHandler, emptyBuf, sc, sm, socketWrapper
-
-
Constructor Summary
Constructors Constructor Description ClosedNioChannel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this channel.voidfree()Free the channel memorybooleanisOpen()Tells whether or not this channel is open.intread(java.nio.ByteBuffer dst)Reads a sequence of bytes from this channel into the given buffer.longread(java.nio.ByteBuffer[] dsts, int offset, int length)voidreset()Reset the channelvoidsetAppReadBufHandler(ApplicationBufferHandler handler)voidsetIOChannel(java.nio.channels.SocketChannel sc)java.lang.StringtoString()intwrite(java.nio.ByteBuffer src)Writes a sequence of bytes to this channel from the given buffer.longwrite(java.nio.ByteBuffer[] srcs, int offset, int length)-
Methods inherited from class org.apache.tomcat.util.net.NioChannel
checkInterruptStatus, close, flush, flushOutbound, getAppReadBufHandler, getBufHandler, getIOChannel, getOutboundRemaining, handshake, isClosing, isHandshakeComplete, read, write
-
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionDescription copied from class:NioChannelCloses this channel.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classNioChannel- Throws:
java.io.IOException- If an I/O error occurs
-
isOpen
public boolean isOpen()
Description copied from class:NioChannelTells whether or not this channel is open.- Specified by:
isOpenin interfacejava.nio.channels.Channel- Overrides:
isOpenin classNioChannel- Returns:
- true if, and only if, this channel is open
-
reset
public void reset() throws java.io.IOExceptionDescription copied from class:NioChannelReset the channel- Overrides:
resetin classNioChannel- Throws:
java.io.IOException- If a problem was encountered resetting the channel
-
free
public void free()
Description copied from class:NioChannelFree the channel memory- Overrides:
freein classNioChannel
-
setIOChannel
public void setIOChannel(java.nio.channels.SocketChannel sc)
- Overrides:
setIOChannelin classNioChannel
-
setAppReadBufHandler
public void setAppReadBufHandler(ApplicationBufferHandler handler)
- Overrides:
setAppReadBufHandlerin classNioChannel
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOExceptionDescription copied from class:NioChannelReads a sequence of bytes from this channel into the given buffer.- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Overrides:
readin classNioChannel- Parameters:
dst- The buffer into which bytes are to be transferred- Returns:
- The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream
- Throws:
java.io.IOException- If some other I/O error occurs
-
read
public long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ScatteringByteChannel- Overrides:
readin classNioChannel- Throws:
java.io.IOException
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOExceptionDescription copied from class:NioChannelWrites a sequence of bytes to this channel from the given buffer.- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Overrides:
writein classNioChannel- Parameters:
src- The buffer from which bytes are to be retrieved- Returns:
- The number of bytes written, possibly zero
- Throws:
java.io.IOException- If some other I/O error occurs
-
write
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.GatheringByteChannel- Overrides:
writein classNioChannel- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classNioChannel
-
-