Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | Protected Attributes | List of all members
arrow::io::BufferReader Class Reference

Random access zero-copy reads on an arrow::Buffer. More...

#include <arrow/io/memory.h>

Inheritance diagram for arrow::io::BufferReader:
arrow::io::RandomAccessFile arrow::io::InputStream arrow::io::Seekable arrow::io::FileInterface arrow::io::Readable arrow::gpu::CudaBufferReader arrow::py::PyBytesReader

Public Member Functions

 BufferReader (const std::shared_ptr< Buffer > &buffer)
 
 BufferReader (const uint8_t *data, int64_t size)
 
Status Close () override
 
Status Tell (int64_t *position) const override
 
Status Read (int64_t nbytes, int64_t *bytes_read, uint8_t *buffer) override
 
Status Read (int64_t nbytes, std::shared_ptr< Buffer > *out) override
 
Status ReadAt (int64_t position, int64_t nbytes, int64_t *bytes_read, uint8_t *out) override
 Read nbytes at position, provide default implementations using Read(...), but can be overridden. More...
 
Status ReadAt (int64_t position, int64_t nbytes, std::shared_ptr< Buffer > *out) override
 Default implementation is thread-safe. More...
 
Status GetSize (int64_t *size) override
 
Status Seek (int64_t position) override
 
bool supports_zero_copy () const override
 
std::shared_ptr< Bufferbuffer () const
 
- Public Member Functions inherited from arrow::io::RandomAccessFile
 ~RandomAccessFile () override
 Necessary because we hold a std::unique_ptr. More...
 
- Public Member Functions inherited from arrow::io::FileInterface
virtual ~FileInterface ()=0
 
FileMode::type mode () const
 
- Public Member Functions inherited from arrow::io::Readable
virtual ~Readable ()=default
 
- Public Member Functions inherited from arrow::io::Seekable
virtual ~Seekable ()=default
 

Protected Attributes

std::shared_ptr< Bufferbuffer_
 
const uint8_t * data_
 
int64_t size_
 
int64_t position_
 
- Protected Attributes inherited from arrow::io::FileInterface
FileMode::type mode_
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::io::RandomAccessFile
 RandomAccessFile ()
 
- Protected Member Functions inherited from arrow::io::InputStream
 InputStream ()=default
 
- Protected Member Functions inherited from arrow::io::FileInterface
 FileInterface ()
 
void set_mode (FileMode::type mode)
 

Detailed Description

Random access zero-copy reads on an arrow::Buffer.

Constructor & Destructor Documentation

◆ BufferReader() [1/2]

arrow::io::BufferReader::BufferReader ( const std::shared_ptr< Buffer > &  buffer)
explicit

◆ BufferReader() [2/2]

arrow::io::BufferReader::BufferReader ( const uint8_t *  data,
int64_t  size 
)

Member Function Documentation

◆ buffer()

std::shared_ptr<Buffer> arrow::io::BufferReader::buffer ( ) const
inline

◆ Close()

Status arrow::io::BufferReader::Close ( )
overridevirtual

◆ GetSize()

Status arrow::io::BufferReader::GetSize ( int64_t *  size)
overridevirtual

◆ Read() [1/2]

Status arrow::io::BufferReader::Read ( int64_t  nbytes,
int64_t *  bytes_read,
uint8_t *  buffer 
)
overridevirtual

Implements arrow::io::Readable.

◆ Read() [2/2]

Status arrow::io::BufferReader::Read ( int64_t  nbytes,
std::shared_ptr< Buffer > *  out 
)
overridevirtual

Implements arrow::io::Readable.

◆ ReadAt() [1/2]

Status arrow::io::BufferReader::ReadAt ( int64_t  position,
int64_t  nbytes,
int64_t *  bytes_read,
uint8_t *  out 
)
overridevirtual

Read nbytes at position, provide default implementations using Read(...), but can be overridden.

Default implementation is thread-safe.

Note
Child classes must explicitly call this implementation or provide their own.
Parameters
[in]positionWhere to read bytes from
[in]nbytesThe number of bytes to read
[out]bytes_readThe number of bytes read
[out]outThe buffer to read bytes into
Returns
Status

Implements arrow::io::RandomAccessFile.

◆ ReadAt() [2/2]

Status arrow::io::BufferReader::ReadAt ( int64_t  position,
int64_t  nbytes,
std::shared_ptr< Buffer > *  out 
)
overridevirtual

Default implementation is thread-safe.

Implements arrow::io::RandomAccessFile.

◆ Seek()

Status arrow::io::BufferReader::Seek ( int64_t  position)
overridevirtual

Implements arrow::io::Seekable.

◆ supports_zero_copy()

bool arrow::io::BufferReader::supports_zero_copy ( ) const
overridevirtual

◆ Tell()

Status arrow::io::BufferReader::Tell ( int64_t *  position) const
overridevirtual

Member Data Documentation

◆ buffer_

std::shared_ptr<Buffer> arrow::io::BufferReader::buffer_
protected

◆ data_

const uint8_t* arrow::io::BufferReader::data_
protected

◆ position_

int64_t arrow::io::BufferReader::position_
protected

◆ size_

int64_t arrow::io::BufferReader::size_
protected

The documentation for this class was generated from the following file: