Top Description Fields Constructors Methods
org.python.modules._io

public Class PyRawIOBase

extends PyIOBase
Class Inheritance
Known Direct Subclasses
org.python.modules._io.PyRawIOBaseDerived, org.python.modules._io.PyFileIO
Annotations
@ExposedType
name:_io._RawIOBase
doc:Base class for raw binary I/O.
base:PyIOBase
Imports
org.python.core.Py, .PyBUF, .PyBuffer, .PyByteArray, .PyList, .PyLong, .PyNewWrapper, .PyObject, .PyString, .PyType, org.python.expose.ExposedMethod, .ExposedNew, .ExposedType

An implementation of Python _io._RawIOBase mirroring the arrangement of methods in the CPython version.

Field Summary

Modifier and TypeField and Description
pack-priv static final String
public static final String
public static final String
public static final String
public static final PyType
public static final String
Inherited from org.python.modules._io.PyIOBase:
__closed__dict__close_docclosed_docfileno_docflush_docisatty_docreadable_docreadline_docreadlines_docseek_docseekable_doctell_doctruncate_docwritable_docwritelines_doc

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static PyObject
_RawIOBase__new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)

pack-priv final PyObject
pack-priv final synchronized PyObject
pack-priv final synchronized PyLong
pack-priv final PyLong
private PyObject

Returns:

a PyString holding the bytes read or Py.None (when a non-blocking source is not ready with further data)
_read
(int
number of bytes to read (if possible)
n
)

Implementation of the read() method once the argument has been reduced to an int.

public PyObject

Returns:

a PyString holding the bytes read or Py.None (when a non-blocking source is not ready with further data)
read
(int
number of bytes to read (if possible)
n
)

The read() method is implemented by calling readinto(); derived classes that want to support read() only need to implement readinto() as a primitive operation.

public PyObject

Returns:

a PyString holding the bytes read or Py.None (when a non-blocking source is not ready with further data)
readall
()

Read until end of file, using multiple read() operations on the underlying stream.

public PyObject

Returns:

number of bytes actually read or Py.None (when a non-blocking source is not ready with further data)
readinto
(PyObject
byte array to try to fill
b
)

Read up to len(b) bytes into bytearray b and return the number of bytes read.

public PyObject

Returns:

the number of bytes written
write
(PyObject
buffer of bytes to be written
b
)

Write the given bytes or bytearray object to the underlying raw stream and return the number of bytes written.

Inherited from org.python.modules._io.PyIOBase:
__del_builtin____enter____exit____iter____iternext___checkClosed_checkClosed_checkReadable_checkReadable_checkSeekable_checkSeekable_checkWritable_checkWritable_IOBase___enter___IOBase___exit___IOBase___new___IOBase__checkClosed_IOBase__checkReadable_IOBase__checkSeekable_IOBase__checkWritable_IOBase__unsupported_IOBase_close_IOBase_fileno_IOBase_flush_IOBase_isatty_IOBase_next_IOBase_readable_IOBase_readline_IOBase_readlines_IOBase_seek_IOBase_seekable_IOBase_tell_IOBase_truncate_IOBase_writable_IOBase_writelinescloseclosedclosed_readonlyfastGetDictfilenoflushisattynextreadablereadablePyBufferreadlinereadlinereadlinesrefersDirectlyToseekseekseekabletailoredTypeErrortelltraversetruncatetruncateunsupportedwritablewritablePyBufferwritelines

Field Detail

docback to summary
pack-priv static final String doc

Hides org.python.modules._io.PyIOBase.doc.

read_docback to summary
public static final String read_doc
readall_docback to summary
public static final String readall_doc
readinto_docback to summary
public static final String readinto_doc
TYPEback to summary
public static final PyType TYPE

Hides org.python.modules._io.PyIOBase.TYPE.

write_docback to summary
public static final String write_doc

Constructor Detail

PyRawIOBaseback to summary
public PyRawIOBase()
PyRawIOBaseback to summary
public PyRawIOBase(PyType subtype)

Method Detail

_RawIOBase__new__back to summary
pack-priv static PyObject _RawIOBase__new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
Annotations
@ExposedNew
_RawIOBase_readback to summary
pack-priv final PyObject _RawIOBase_read(PyObject n)
Annotations
@ExposedMethod
defaults:null
doc:Read up to n bytes from the object and return them. As a convenience, if n is unspecified or -1, readall() is called.
_RawIOBase_readallback to summary
pack-priv final synchronized PyObject _RawIOBase_readall()
Annotations
@ExposedMethod
doc:Read and return all the bytes from the stream until EOF, using multiple calls to the stream if necessary.
_RawIOBase_readintoback to summary
pack-priv final synchronized PyLong _RawIOBase_readinto(PyObject b)
Annotations
@ExposedMethod
doc:Read up to len(b) bytes into bytearray b and return the number of bytes read. If the object is in non-blocking mode and no bytes are available, None is returned.
_RawIOBase_writeback to summary
pack-priv final PyLong _RawIOBase_write(PyObject b)
Annotations
@ExposedMethod
doc:Write the given bytes or bytearray object, b, to the underlying raw stream and return the number of bytes written.
_readback to summary
private PyObject _read(int n)

Implementation of the read() method once the argument has been reduced to an int.

Parameters
n:int

number of bytes to read (if possible)

Returns:PyObject

a PyString holding the bytes read or Py.None (when a non-blocking source is not ready with further data)

readback to summary
public PyObject read(int n)

The read() method is implemented by calling readinto(); derived classes that want to support read() only need to implement readinto() as a primitive operation. In general, readinto() can be more efficient than read().

Parameters
n:int

number of bytes to read (if possible)

Returns:PyObject

a PyString holding the bytes read or Py.None (when a non-blocking source is not ready with further data)

readallback to summary
public PyObject readall()

Read until end of file, using multiple read() operations on the underlying stream. If the first read() returns None (only possible in the case of a non-blocking stream), this method returns None.

Returns:PyObject

a PyString holding the bytes read or Py.None (when a non-blocking source is not ready with further data)

readintoback to summary
public PyObject readinto(PyObject b)

Read up to len(b) bytes into bytearray b and return the number of bytes read. If the object is in non-blocking mode and no bytes are available, None is returned.";

Parameters
b:PyObject

byte array to try to fill

Returns:PyObject

number of bytes actually read or Py.None (when a non-blocking source is not ready with further data)

writeback to summary
public PyObject write(PyObject b)

Write the given bytes or bytearray object to the underlying raw stream and return the number of bytes written.

Parameters
b:PyObject

buffer of bytes to be written

Returns:PyObject

the number of bytes written