| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/pyarrow.FixedSizeBufferWriter.html | [Back] [Original] |
Bases: NativeFile
A stream writing to a Arrow buffer.
Examples
Create a stream to write to pyarrow.Buffer:
>>> import pyarrow as pa
>>> buf = pa.allocate_buffer(5)
>>> with pa.output_stream(buf) as stream:
... stream.write(b'abcde')
... stream
...
5
<pyarrow.FixedSizeBufferWriter closed=False own_file=False is_seekable=False is_writable=True is_readable=False>
Inspect the buffer:
>>> buf.to_pybytes()
b'abcde'
>>> buf
<pyarrow.Buffer address=... size=5 is_cpu=True is_mutable=True>
Methods
|
|
|
|
|
Read this file completely to a local path or destination stream. |
|
NOT IMPLEMENTED |
|
Flush the stream, if applicable. |
|
Return an input stream that reads a file segment independent of the state of the file. |
|
|
|
Return file metadata |
|
Read and return up to n bytes. |
|
Read and return up to n bytes. |
|
Read indicated number of bytes at offset from the file |
|
Read from buffer. |
|
|
|
|
|
Read into the supplied buffer |
|
NOT IMPLEMENTED. |
|
NOT IMPLEMENTED. |
|
Change current file stream position |
|
|
|
|
|
|
|
|
|
Return file size |
|
Return current stream position |
|
NOT IMPLEMENTED |
|
Write from a source stream to this file. |
|
|
|
Write data to the file. |
|
Write lines to the file. |
Attributes
Read this file completely to a local path or destination stream.
This method first seeks to the beginning of the file.
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.
NativeFileReturn 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.
Read and return up to n bytes.
Unlike read(), if nbytes is None then a chunk is read, not the entire file.
Read indicated number of bytes at offset from the file
Read from buffer.
int, optionalmaximum number of bytes read
Read into the supplied buffer
A writable buffer object (such as a bytearray).
intnumber 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 bn.
intmaximum number of bytes read
NOT IMPLEMENTED. Read lines of the file
intmaximum number of bytes read until we stop
Change current file stream position
intThe 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, optionalThe buffer size to use for data transfers.
| Web Proxy Viewer | New URL | Original Page |