Top Description Fields Constructors Methods
org.python.core.io

public Class DatagramSocketIO

extends SocketIOBase<DatagramChannel>
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.DatagramChannel, org.python.core.Py

Raw I/O implementation for datagram sockets.
Author
Philip Jenvey

Field Summary

Inherited from org.python.core.io.SocketIOBase:
socketChannel

Constructor Summary

AccessConstructor and Description
public
DatagramSocketIO(DatagramChannel
a DatagramChannel to wrap
socketChannel
,
String
a raw io socket mode String
mode
)

Construct a DatagramSocketIO for the given DatagramChannel.

Method Summary

Modifier and TypeMethod and Description
public int
readinto(ByteBuffer
a ByteBuffer to read bytes into
buf
)

Overrides org.python.core.io.RawIOBase.readinto.

Read up to buf.remaining() bytes into buf.

public long

Returns:

the amount of data read as a long
readinto
(ByteBuffer[]
an array of ByteBuffers to read bytes into
bufs
)

Overrides org.python.core.io.RawIOBase.readinto.

Read bytes into each of the specified ByteBuffers via scatter i/o.

public int
write(ByteBuffer
a ByteBuffer value
buf
)

Overrides org.python.core.io.RawIOBase.write.

Write the given ByteBuffer to the IO stream.

public long

Returns:

the number of bytes written as a long
write
(ByteBuffer[]
an array of ByteBuffers
bufs
)

Overrides org.python.core.io.RawIOBase.write.

Writes bytes from each of the specified ByteBuffers via gather i/o.

Inherited from org.python.core.io.SocketIOBase:
closegetChannelparseModereadablewritable

Constructor Detail

DatagramSocketIOback to summary
public DatagramSocketIO(DatagramChannel socketChannel, String mode)

Construct a DatagramSocketIO for the given DatagramChannel.

Parameters
socketChannel:DatagramChannel

a DatagramChannel to wrap

mode:String

a raw io socket mode String

Method Detail

readintoback to summary
public int readinto(ByteBuffer buf)

Overrides org.python.core.io.RawIOBase.readinto.

Doc from org.python.core.io.RawIOBase.readinto.

Read up to buf.remaining() bytes into buf. Returns number of bytes read (0 for EOF).

Parameters
buf:ByteBuffer

a ByteBuffer to read bytes into

Returns:int

the amount of data read as an int

Annotations
@Override

readintoback to summary
public long readinto(ByteBuffer[] bufs)

Overrides org.python.core.io.RawIOBase.readinto.

Read bytes into each of the specified ByteBuffers via scatter i/o.

Parameters
bufs:ByteBuffer[]

Doc from org.python.core.io.RawIOBase.readinto.

an array of ByteBuffers to read bytes into

Returns:long

Doc from org.python.core.io.RawIOBase.readinto.

the amount of data read as a long

Annotations
@Override

writeback to summary
public int write(ByteBuffer buf)

Overrides org.python.core.io.RawIOBase.write.

Doc from org.python.core.io.RawIOBase.write.

Write the given ByteBuffer to the IO stream. Returns the number of bytes written, which may be less than buf.remaining().

Parameters
buf:ByteBuffer

a ByteBuffer value

Returns:int

the number of bytes written as an int

Annotations
@Override

writeback to summary
public long write(ByteBuffer[] bufs)

Overrides org.python.core.io.RawIOBase.write.

Writes bytes from each of the specified ByteBuffers via gather i/o.

Parameters
bufs:ByteBuffer[]

Doc from org.python.core.io.RawIOBase.write.

an array of ByteBuffers

Returns:long

Doc from org.python.core.io.RawIOBase.write.

the number of bytes written as a long

Annotations
@Override