gi-gio-2.0.35: Gio bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | Safe-Inferred
Language | Haskell2010

GI.Gio.Objects.MemoryInputStream

Contents

- Exported types
- Methods
  - addBytes
  - addData
  - new
  - newFromBytes
  - newFromData

Description

`GMemoryInputStream` is a class for using arbitrary memory chunks as input for GIO streaming input operations.

As of GLib 2.34, `GMemoryInputStream` implements `PollableInputStream`.

Synopsis

- newtype MemoryInputStream = MemoryInputStream (ManagedPtr MemoryInputStream)
- class (GObject o, IsDescendantOf MemoryInputStream o) => IsMemoryInputStream o
- toMemoryInputStream :: (MonadIO m, IsMemoryInputStream o) => o -> m MemoryInputStream
- memoryInputStreamAddBytes :: (HasCallStack, MonadIO m, IsMemoryInputStream a) => a -> Bytes -> m ()
- memoryInputStreamAddData :: (HasCallStack, MonadIO m, IsMemoryInputStream a) => a -> ByteString -> Maybe DestroyNotify -> m ()
- memoryInputStreamNew :: (HasCallStack, MonadIO m) => m MemoryInputStream
- memoryInputStreamNewFromBytes :: (HasCallStack, MonadIO m) => Bytes -> m MemoryInputStream
- memoryInputStreamNewFromData :: (HasCallStack, MonadIO m) => ByteString -> Maybe DestroyNotify -> m MemoryInputStream

# Exported types

newtype MemoryInputStream Source #

Memory-managed wrapper type.

Constructors

MemoryInputStream (ManagedPtr MemoryInputStream) |

#### Instances

Instances details

Eq MemoryInputStream Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream Methods (==) :: MemoryInputStream -> MemoryInputStream -> Bool Source # (/=) :: MemoryInputStream -> MemoryInputStream -> Bool Source #
GObject MemoryInputStream Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream
ManagedPtrNewtype MemoryInputStream Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream Methods toManagedPtr :: MemoryInputStream -> ManagedPtr MemoryInputStream Source #
TypedObject MemoryInputStream Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream Methods glibType :: IO GType Source #
HasParentTypes MemoryInputStream Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream
IsGValue (Maybe MemoryInputStream) Source # | Convert `MemoryInputStream` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.MemoryInputStream Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe MemoryInputStream -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe MemoryInputStream) Source #
type ParentTypes MemoryInputStream Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream type ParentTypes MemoryInputStream = '[InputStream, Object, PollableInputStream, Seekable]

class (GObject o, IsDescendantOf MemoryInputStream o) => IsMemoryInputStream o Source #

Type class for types which can be safely cast to `MemoryInputStream`, for instance with `toMemoryInputStream`.

#### Instances

Instances details

(GObject o, IsDescendantOf MemoryInputStream o) => IsMemoryInputStream o Source # |
Instance details Defined in GI.Gio.Objects.MemoryInputStream

toMemoryInputStream :: (MonadIO m, IsMemoryInputStream o) => o -> m MemoryInputStream Source #

Cast to `MemoryInputStream`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

addBytes, addData, bindProperty, bindPropertyFull, canPoll, canSeek, canTruncate, clearPending, close, closeAsync, closeFinish, createSource, forceFloating, freezeNotify, getv, hasPending, isClosed, isFloating, isReadable, notify, notifyByPspec, read, readAll, readAllAsync, readAllFinish, readAsync, readBytes, readBytesAsync, readBytesFinish, readFinish, readNonblocking, ref, refSink, runDispose, seek, skip, skipAsync, skipFinish, stealData, stealQdata, tell, thawNotify, truncate, unref, watchClosure.

#### Getters

getData, getProperty, getQdata.

#### Setters

setData, setDataFull, setPending, setProperty.

## addBytes

memoryInputStreamAddBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsMemoryInputStream a) |
=> a | `stream`: a `MemoryInputStream`
-> Bytes | `bytes`: input data
-> m () |

Appends `bytes` to data that can be read from the input stream.

Since: 2.34

## addData

memoryInputStreamAddData Source #

Arguments

:: (HasCallStack, MonadIO m, IsMemoryInputStream a) |
=> a | `stream`: a `MemoryInputStream`
-> ByteString | `data`: input data
-> Maybe DestroyNotify | `destroy`: function that is called to free `data`, or `Nothing`
-> m () |

Appends `data` to data that can be read from the input stream

## new

memoryInputStreamNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m MemoryInputStream | Returns: a new `InputStream`

Creates a new empty `MemoryInputStream`.

## newFromBytes

memoryInputStreamNewFromBytes Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Bytes | `bytes`: a `Bytes`
-> m MemoryInputStream | Returns: new `InputStream` read from `bytes`

Creates a new `MemoryInputStream` with data from the given `bytes`.

Since: 2.34

## newFromData

memoryInputStreamNewFromData Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> ByteString | `data`: input data
-> Maybe DestroyNotify | `destroy`: function that is called to free `data`, or `Nothing`
-> m MemoryInputStream | Returns: new `InputStream` read from `data` of `len` bytes.

Creates a new `MemoryInputStream` with data in memory of a given size.