org.python.core.io
Class SocketIO
java.lang.Object
org.python.core.io.IOBase
org.python.core.io.RawIOBase
org.python.core.io.SocketIOBase<SocketChannel>
org.python.core.io.SocketIO
public class SocketIO
- extends SocketIOBase<SocketChannel>
Raw I/O implementation for sockets.
- Author:
- Philip Jenvey
Method Summary |
int |
readinto(ByteBuffer buf)
Read up to buf.remaining() bytes into buf. |
long |
readinto(ByteBuffer[] bufs)
Read bytes into each of the specified ByteBuffers via scatter
i/o. |
int |
write(ByteBuffer buf)
Write the given ByteBuffer to the IO stream. |
long |
write(ByteBuffer[] bufs)
Writes bytes from each of the specified ByteBuffers via gather
i/o. |
Methods inherited from class org.python.core.io.IOBase |
asInputStream, asOutputStream, checkClosed, checkReadable, checkWritable, closed, flush, isatty, seek, seek, tell, truncate |
SocketIO
public SocketIO(SocketChannel socketChannel,
String mode)
- Construct a SocketIO for the given SocketChannel.
- Parameters:
socketChannel
- a SocketChannel to wrapmode
- a raw io socket mode String
readinto
public int readinto(ByteBuffer buf)
- Description copied from class:
RawIOBase
- Read up to buf.remaining() bytes into buf.
Returns number of bytes read (0 for EOF).
- Overrides:
readinto
in class RawIOBase
- Parameters:
buf
- a ByteBuffer to read bytes into
- Returns:
- the amount of data read as an int
readinto
public long readinto(ByteBuffer[] bufs)
- Read bytes into each of the specified ByteBuffers via scatter
i/o.
- Overrides:
readinto
in class RawIOBase
- Parameters:
bufs
- an array of ByteBuffers to read bytes into
- Returns:
- the amount of data read as a long
write
public int write(ByteBuffer buf)
- Description copied from class:
RawIOBase
- Write the given ByteBuffer to the IO stream.
Returns the number of bytes written, which may be less than
buf.remaining().
- Overrides:
write
in class RawIOBase
- Parameters:
buf
- a ByteBuffer value
- Returns:
- the number of bytes written as an int
write
public long write(ByteBuffer[] bufs)
- Writes bytes from each of the specified ByteBuffers via gather
i/o.
- Overrides:
write
in class RawIOBase
- Parameters:
bufs
- an array of ByteBuffers
- Returns:
- the number of bytes written as a long
Jython homepage