Package org.python.core.io
Class SocketIO
Raw I/O implementation for sockets.
- Author:
- Philip Jenvey
-
Field Summary
Fields inherited from class org.python.core.io.IOBase
DEFAULT_BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSocketIO(SocketChannel socketChannel, String mode) Construct a SocketIO for the given SocketChannel. -
Method Summary
Modifier and TypeMethodDescriptionintreadinto(ByteBuffer buf) Read up to buf.remaining() bytes into buf.longreadinto(ByteBuffer[] bufs) Read bytes into each of the specified ByteBuffers via scatter i/o.intwrite(ByteBuffer buf) Write the given ByteBuffer to the IO stream.longwrite(ByteBuffer[] bufs) Writes bytes from each of the specified ByteBuffers via gather i/o.Methods inherited from class org.python.core.io.SocketIOBase
close, getChannel, readable, writableMethods inherited from class org.python.core.io.IOBase
asInputStream, asOutputStream, checkClosed, checkReadable, checkWritable, closed, flush, isatty, seek, seek, tell, truncate
-
Constructor Details
-
SocketIO
Construct a SocketIO for the given SocketChannel.- Parameters:
socketChannel- a SocketChannel to wrapmode- a raw io socket mode String
-
-
Method Details
-
readinto
Description copied from class:RawIOBaseRead up to buf.remaining() bytes into buf. Returns number of bytes read (0 for EOF). -
readinto
Read bytes into each of the specified ByteBuffers via scatter i/o. -
write
Description copied from class:RawIOBaseWrite the given ByteBuffer to the IO stream. Returns the number of bytes written, which may be less than buf.remaining(). -
write
Writes bytes from each of the specified ByteBuffers via gather i/o.
-