Package org.python.core.io

# Class SocketIOBase<T extends Channel>

java.lang.Object
org.python.core.io.IOBase
org.python.core.io.RawIOBase
org.python.core.io.SocketIOBase<T>

Direct Known Subclasses:
  `DatagramSocketIO`, `ServerSocketIO`, `SocketIO`

public abstract class SocketIOBase<T extends Channel> extends RawIOBase
Base 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

Constructors
Constructor
Description
`SocketIOBase(T socketChannel, String mode)`
Construct a SocketIOBase for the given socket Channel

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Flushes and closes the IO object.
`T`
`getChannel()`
Return the underlying Java nio Channel.
`boolean`
`readable()`
Return whether this file was opened for reading.
`boolean`
`writable()`
Return whether this file was opened for writing.

### Methods inherited from class org.python.core.io.RawIOBase

`fileno, read, readall, readinto, readinto, write, write`

### Methods inherited from class org.python.core.io.IOBase

`asInputStream, asOutputStream, checkClosed, checkReadable, checkWritable, closed, flush, isatty, seek, seek, tell, truncate`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SocketIOBase

public SocketIOBase(T socketChannel, String mode)
Construct a SocketIOBase for the given socket Channel

Parameters:
  `socketChannel` - a Channel to wrap
  `mode` - a raw io socket mode String

## Method Details

### close

public void close()
Description copied from class: `IOBase`
Flushes and closes the IO object. This must be idempotent. It should also set a flag for the 'closed' property (see below) to test.

Overrides:
  `close` in class `IOBase`

### getChannel

public T getChannel()
Description copied from class: `RawIOBase`
Return the underlying Java nio Channel.

Specified by:
  `getChannel` in class `RawIOBase`
Returns:
  the underlying Java nio Channel

### readable

public boolean readable()
Description copied from class: `IOBase`
Return whether this file was opened for reading.

Overrides:
  `readable` in class `IOBase`
Returns:
  true if the file was opened for reading

### writable

public boolean writable()
Description copied from class: `IOBase`
Return whether this file was opened for writing.

Overrides:
  `writable` in class `IOBase`
Returns:
  true if the file was opened for writing