Input stream classes

Input stream classes

Functions

Properties

GInputStream * raw Read / Write / Construct Only
GArrowBuffer * buffer Read / Write / Construct Only
GArrowCodec * codec Read / Write / Construct Only
GArrowInputStream * raw Read / Write / Construct Only
gpointer input-stream Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GInputStream
        ╰── GArrowInputStream
            ├── GArrowSeekableInputStream
               ├── GArrowBufferInputStream
               ├── GArrowFileInputStream
               ├── GArrowGIOInputStream
               ├── GArrowMemoryMappedInputStream
               ╰── GArrowMemoryMappedInputStream
            ├── GArrowCompressedInputStream
            ├── GArrowCompressedInputStream
            ╰── GArrowSeekableInputStream
                ├── GArrowBufferInputStream
                   ╰── GArrowCUDABufferInputStream
                ├── GArrowFileInputStream
                ╰── GArrowGIOInputStream

Implemented Interfaces

GArrowGIOInputStream implements GArrowFile and GArrowReadable.

GArrowBufferInputStream implements GArrowFile and GArrowReadable.

GArrowCompressedInputStream implements GArrowFile and GArrowReadable.

GArrowFileInputStream implements GArrowFile and GArrowReadable.

GArrowInputStream implements GArrowFile and GArrowReadable.

GArrowMemoryMappedInputStream implements GArrowFile and GArrowReadable.

GArrowSeekableInputStream implements GArrowFile and GArrowReadable.

Includes

#include <arrow-glib/arrow-glib.h>

Description

GArrowInputStream is a base class for input stream.

GArrowSeekableInputStream is a base class for input stream that supports random access.

GArrowBufferInputStream is a class to read data on buffer.

GArrowFileInputStream is a class to read data in file.

GArrowMemoryMappedInputStream is a class to read data in file by mapping the file on memory. It supports zero copy.

GArrowGIOInputStream is a class for GInputStream based input stream.

GArrowCompressedInputStream is a class to read data from compressed input stream.

Functions

garrow_input_stream_advance ()

gboolean
garrow_input_stream_advance (GArrowInputStream *input_stream,
                             gint64 n_bytes,
                             GError **error);

Parameters

input_stream

A GArrowInputStream.

 

n_bytes

The number of bytes to be advanced.

 

error

Return location for a GError or NULL.

[nullable]

Returns

TRUE on success, FALSE on error.

Since: 0.11.0


garrow_input_stream_align ()

gboolean
garrow_input_stream_align (GArrowInputStream *input_stream,
                           gint32 alignment,
                           GError **error);

Parameters

input_stream

A GArrowInputStream.

 

alignment

The byte multiple for the metadata prefix, usually 8 or 64, to ensure the body starts on a multiple of that alignment.

 

error

Return location for a GError or NULL.

[nullable]

Returns

TRUE on success, FALSE on error.

Since: 0.11.0


garrow_input_stream_read_tensor ()

GArrowTensor *
garrow_input_stream_read_tensor (GArrowInputStream *input_stream,
                                 GError **error);

Parameters

input_stream

A GArrowInputStream.

 

error

Return location for a GError or NULL.

[nullable]

Returns

GArrowTensor on success, NULL on error.

[transfer full][nullable]

Since: 0.11.0


garrow_input_stream_read_record_batch ()

GArrowRecordBatch *
garrow_input_stream_read_record_batch (GArrowInputStream *input_stream,
                                       GArrowSchema *schema,
                                       GArrowReadOptions *options,
                                       GError **error);

Parameters

input_stream

A GArrowInputStream.

 

schema

A GArrowSchema for a read record batch.

 

options

A GArrowReadOptions.

[nullable]

error

Return location for a GError or NULL.

[nullable]

Returns

GArrowRecordBatch on success, NULL on error.

[transfer full][nullable]

Since: 1.0.0


garrow_seekable_input_stream_get_size ()

guint64
garrow_seekable_input_stream_get_size (GArrowSeekableInputStream *input_stream,
                                       GError **error);

Parameters

input_stream

A GArrowSeekableInputStream.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The size of the file.


garrow_seekable_input_stream_get_support_zero_copy ()

gboolean
garrow_seekable_input_stream_get_support_zero_copy
                               (GArrowSeekableInputStream *input_stream);

Parameters

input_stream

A GArrowSeekableInputStream.

 

Returns

Whether zero copy read is supported or not.


garrow_seekable_input_stream_read_at ()

GArrowBuffer *
garrow_seekable_input_stream_read_at (GArrowSeekableInputStream *input_stream,
                                      gint64 position,
                                      gint64 n_bytes,
                                      GError **error);

Parameters

input_stream

A GArrowSeekableInputStream.

 

position

The read start position.

 

n_bytes

The number of bytes to be read.

 

error

Return location for a GError or NULL.

[nullable]

Returns

GArrowBuffer that has read data on success, NULL if there was an error.

[transfer full][nullable]


garrow_seekable_input_stream_read_at_bytes ()

GBytes *
garrow_seekable_input_stream_read_at_bytes
                               (GArrowSeekableInputStream *input_stream,
                                gint64 position,
                                gint64 n_bytes,
                                GError **error);

Parameters

input_stream

A GArrowSeekableInputStream.

 

position

The read start position.

 

n_bytes

The number of bytes to be read.

 

error

Return location for a GError or NULL.

[nullable]

Returns

GBytes that has read data on success, NULL if there was an error.

[transfer full][nullable]

Since: 0.15.0


garrow_seekable_input_stream_peek ()

GBytes *
garrow_seekable_input_stream_peek (GArrowSeekableInputStream *input_stream,
                                   gint64 n_bytes,
                                   GError **error);

Parameters

input_stream

A GArrowSeekableInputStream.

 

n_bytes

The number of bytes to be peeked.

 

error

Return location for a GError or NULL.

[nullable]

Returns

The data of the buffer, up to the indicated number. The data becomes invalid after any operation on the stream. If the stream is unbuffered, the data is empty.

It should be freed with g_bytes_unref() when no longer needed.

[transfer full]

Since: 0.12.0


garrow_buffer_input_stream_new ()

GArrowBufferInputStream *
garrow_buffer_input_stream_new (GArrowBuffer *buffer);

Parameters

buffer

The buffer to be read.

 

Returns

A newly created GArrowBufferInputStream.


garrow_buffer_input_stream_get_buffer ()

GArrowBuffer *
garrow_buffer_input_stream_get_buffer (GArrowBufferInputStream *input_stream);

Parameters

input_stream

A GArrowBufferInputStream.

 

Returns

The data of the stream as GArrowBuffer.

[transfer full]


garrow_file_input_stream_new ()

GArrowFileInputStream *
garrow_file_input_stream_new (const gchar *path,
                              GError **error);

Parameters

path

The path of the file to be opened.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowFileInputStream or NULL on error.

[nullable]

Since: 6.0.0


garrow_file_input_stream_new_file_descriptor ()

GArrowFileInputStream *
garrow_file_input_stream_new_file_descriptor
                               (gint file_descriptor,
                                GError **error);

Parameters

file_descriptor

The file descriptor of this input stream.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowFileInputStream or NULL on error.

[nullable]

Since: 6.0.0


garrow_file_input_stream_get_file_descriptor ()

gint
garrow_file_input_stream_get_file_descriptor
                               (GArrowFileInputStream *stream);

Parameters

stream

A GArrowFileInuptStream.

 

Returns

The file descriptor of stream .

Since: 6.0.0


garrow_memory_mapped_input_stream_new ()

GArrowMemoryMappedInputStream *
garrow_memory_mapped_input_stream_new (const gchar *path,
                                       GError **error);

Parameters

path

The path of the file to be mapped on memory.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowMemoryMappedInputStream or NULL on error.

[nullable]


garrow_gio_input_stream_new ()

GArrowGIOInputStream *
garrow_gio_input_stream_new (GInputStream *gio_input_stream);

Parameters

gio_input_stream

The stream to be read.

 

Returns

A newly created GArrowGIOInputStream.

[transfer full]

Since: 0.5.0


garrow_gio_input_stream_get_raw ()

GInputStream *
garrow_gio_input_stream_get_raw (GArrowGIOInputStream *input_stream);

garrow_gio_input_stream_get_raw has been deprecated since version 0.12.0 and should not be used in newly-written code.

Use GArrowGIOInputStream::raw property instead.

Parameters

input_stream

A GArrowGIOInputStream.

 

Returns

The wrapped GInputStream.

[transfer none]

Since: 0.5.0


garrow_compressed_input_stream_new ()

GArrowCompressedInputStream *
garrow_compressed_input_stream_new (GArrowCodec *codec,
                                    GArrowInputStream *raw,
                                    GError **error);

Parameters

codec

A GArrowCodec for compressed data in the raw .

 

raw

A GArrowInputStream that contains compressed data.

 

error

Return location for a GError or NULL.

[nullable]

Returns

A newly created GArrowCompressedInputStream.

Since: 0.12.0

Types and Values

GARROW_TYPE_INPUT_STREAM

#define GARROW_TYPE_INPUT_STREAM (garrow_input_stream_get_type())

struct GArrowInputStreamClass

struct GArrowInputStreamClass {
  GInputStreamClass parent_class;
};

GARROW_TYPE_SEEKABLE_INPUT_STREAM

#define             GARROW_TYPE_SEEKABLE_INPUT_STREAM

struct GArrowSeekableInputStreamClass

struct GArrowSeekableInputStreamClass {
  GArrowInputStreamClass parent_class;
};

GARROW_TYPE_BUFFER_INPUT_STREAM

#define             GARROW_TYPE_BUFFER_INPUT_STREAM

struct GArrowBufferInputStreamClass

struct GArrowBufferInputStreamClass {
  GArrowSeekableInputStreamClass parent_class;
};

GARROW_TYPE_FILE_INPUT_STREAM

#define GARROW_TYPE_FILE_INPUT_STREAM (garrow_file_input_stream_get_type())

struct GArrowFileInputStreamClass

struct GArrowFileInputStreamClass {
  GArrowSeekableInputStreamClass parent_class;
};

GARROW_TYPE_MEMORY_MAPPED_INPUT_STREAM

#define             GARROW_TYPE_MEMORY_MAPPED_INPUT_STREAM

struct GArrowMemoryMappedInputStreamClass

struct GArrowMemoryMappedInputStreamClass {
  GArrowSeekableInputStreamClass parent_class;
};

struct GArrowGIOInputStream

struct GArrowGIOInputStream;

It's an input stream for GInputStream.


GARROW_TYPE_COMPRESSED_INPUT_STREAM

#define             GARROW_TYPE_COMPRESSED_INPUT_STREAM

struct GArrowCompressedInputStreamClass

struct GArrowCompressedInputStreamClass {
  GArrowInputStreamClass parent_class;
};

GArrowBufferInputStream

typedef struct _GArrowBufferInputStream GArrowBufferInputStream;

GArrowCompressedInputStream

typedef struct _GArrowCompressedInputStream GArrowCompressedInputStream;

GArrowFileInputStream

typedef struct _GArrowFileInputStream GArrowFileInputStream;

GArrowInputStream

typedef struct _GArrowInputStream GArrowInputStream;

GArrowMemoryMappedInputStream

typedef struct _GArrowMemoryMappedInputStream GArrowMemoryMappedInputStream;

GArrowSeekableInputStream

typedef struct _GArrowSeekableInputStream GArrowSeekableInputStream;

Property Details

The “raw” property

  “raw”                      GInputStream *

The raw GInputStream *.

Owner: GArrowGIOInputStream

Flags: Read / Write / Construct Only


The “buffer” property

  “buffer”                   GArrowBuffer *

The data.

Owner: GArrowBufferInputStream

Flags: Read / Write / Construct Only


The “codec” property

  “codec”                    GArrowCodec *

The codec for the stream.

Owner: GArrowCompressedInputStream

Flags: Read / Write / Construct Only


The “raw” property

  “raw”                      GArrowInputStream *

The underlying raw input stream.

Owner: GArrowCompressedInputStream

Flags: Read / Write / Construct Only


The “input-stream” property

  “input-stream”             gpointer

The raw std::shared<arrow::io::InputStream> *.

Owner: GArrowInputStream

Flags: Write / Construct Only