Bases: _Weakrefable
The base class for all Arrow streams.
Streams are either readable, writable, or both. They optionally support seeking.
While this class exposes methods to read or write data from Python, the primary intent of using a Arrow stream is to pass it to other Arrow facilities that will make use of it, such as Arrow IPC routines.
Be aware that there are subtle differences with regular Python files, e.g. destroying a writable Arrow stream without closing it explicitly will not flush any pending data.
Methods
Attributes
Read this file completely to a local path or destination stream.
This method first seeks to the beginning of the file.
str
or file-like object
If a string, a local file path to write to; otherwise, should be a writable stream.
int
, optional
The buffer size to use for data transfers.
NOT IMPLEMENTED
Flush the stream, if applicable.
An error is raised if stream is not writable.
Return an input stream that reads a file segment independent of the state of the file.
Allows reading portions of a random access file as an input stream without interfering with each other.
int
int
NativeFile
Return file metadata
The file mode. Currently instances of NativeFile may support:
rb: binary read
wb: binary write
rb+: binary read and write
ab: binary append
Read and return up to n bytes.
If nbytes is None, then the entire remaining file contents are read.
int
, default None
bytes
Read and return up to n bytes.
Unlike read(), if nbytes is None then a chunk is read, not the entire file.
int
, default None
The maximum number of bytes to read.
bytes
Read indicated number of bytes at offset from the file
int
int
bytes
Read from buffer.
int
, optional
maximum number of bytes read
Read into the supplied buffer
A writable buffer object (such as a bytearray).
int
number of bytes written
NOT IMPLEMENTED. Read and return a line of bytes from the file.
If size is specified, read at most size bytes.
Line terminator is always bânâ.
int
maximum number of bytes read
NOT IMPLEMENTED. Read lines of the file
int
maximum number of bytes read until we stop
Change current file stream position
int
Byte offset, interpreted relative to value of whence argument
int
, default 0
Point of reference for seek offset
int
The new absolute stream position.
Notes
Values of whence: * 0 â start of stream (the default); offset should be zero or positive * 1 â current stream position; offset may be negative * 2 â end of stream; offset is usually negative
Return file size
Return current stream position
NOT IMPLEMENTED
Write from a source stream to this file.
Source stream to pipe to this file.
int
, optional
The buffer size to use for data transfers.
Write data to the file.
exporter
of buffer protocol
int
nbytes: number of bytes written
Write lines to the file.
Iterable of bytes-like objects or exporters of buffer protocol
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4