gi-gio-2.0.27: Gio bindings

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

GI.Gio.Objects.DataOutputStream

Contents

- Exported types
- Methods
  - Overloaded methods
  - getByteOrder
  - new
  - putByte
  - putInt16
  - putInt32
  - putInt64
  - putString
  - putUint16
  - putUint32
  - putUint64
  - setByteOrder
- Properties
  - byteOrder

Description

Data output stream implements `OutputStream` and includes functions for writing data directly to an output stream.

Synopsis

- newtype DataOutputStream = DataOutputStream (ManagedPtr DataOutputStream)
- class (GObject o, IsDescendantOf DataOutputStream o) => IsDataOutputStream o
- toDataOutputStream :: (MonadIO m, IsDataOutputStream o) => o -> m DataOutputStream
- dataOutputStreamGetByteOrder :: (HasCallStack, MonadIO m, IsDataOutputStream a) => a -> m DataStreamByteOrder
- dataOutputStreamNew :: (HasCallStack, MonadIO m, IsOutputStream a) => a -> m DataOutputStream
- dataOutputStreamPutByte :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Word8 -> Maybe b -> m ()
- dataOutputStreamPutInt16 :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Int16 -> Maybe b -> m ()
- dataOutputStreamPutInt32 :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Int32 -> Maybe b -> m ()
- dataOutputStreamPutInt64 :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Int64 -> Maybe b -> m ()
- dataOutputStreamPutString :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Text -> Maybe b -> m ()
- dataOutputStreamPutUint16 :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Word16 -> Maybe b -> m ()
- dataOutputStreamPutUint32 :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Word32 -> Maybe b -> m ()
- dataOutputStreamPutUint64 :: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) => a -> Word64 -> Maybe b -> m ()
- dataOutputStreamSetByteOrder :: (HasCallStack, MonadIO m, IsDataOutputStream a) => a -> DataStreamByteOrder -> m ()
- constructDataOutputStreamByteOrder :: (IsDataOutputStream o, MonadIO m) => DataStreamByteOrder -> m (GValueConstruct o)
- getDataOutputStreamByteOrder :: (MonadIO m, IsDataOutputStream o) => o -> m DataStreamByteOrder
- setDataOutputStreamByteOrder :: (MonadIO m, IsDataOutputStream o) => o -> DataStreamByteOrder -> m ()

# Exported types

newtype DataOutputStream Source #

Memory-managed wrapper type.

Constructors

DataOutputStream (ManagedPtr DataOutputStream) |

#### Instances

Instances details

Eq DataOutputStream Source # |
Instance details Defined in GI.Gio.Objects.DataOutputStream Methods (==) :: DataOutputStream -> DataOutputStream -> Bool # (/=) :: DataOutputStream -> DataOutputStream -> Bool #
GObject DataOutputStream Source # |
Instance details Defined in GI.Gio.Objects.DataOutputStream
TypedObject DataOutputStream Source # |
Instance details Defined in GI.Gio.Objects.DataOutputStream Methods glibType :: IO GType Source #
ManagedPtrNewtype DataOutputStream Source # |
Instance details Defined in GI.Gio.Objects.DataOutputStream Methods toManagedPtr :: DataOutputStream -> ManagedPtr DataOutputStream Source #
IsGValue DataOutputStream Source # | Convert `DataOutputStream` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.DataOutputStream Methods toGValue :: DataOutputStream -> IO GValue Source # fromGValue :: GValue -> IO DataOutputStream Source #
HasParentTypes DataOutputStream Source # |
Instance details Defined in GI.Gio.Objects.DataOutputStream
type ParentTypes DataOutputStream Source # |
Instance details Defined in GI.Gio.Objects.DataOutputStream type ParentTypes DataOutputStream = '[FilterOutputStream, OutputStream, Object, Seekable]

class (GObject o, IsDescendantOf DataOutputStream o) => IsDataOutputStream o Source #

Type class for types which can be safely cast to `DataOutputStream`, for instance with `toDataOutputStream`.

#### Instances

Instances details

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

toDataOutputStream :: (MonadIO m, IsDataOutputStream o) => o -> m DataOutputStream Source #

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

# Methods

## Overloaded methods

## getByteOrder

dataOutputStreamGetByteOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a) |
=> a | `stream`: a `DataOutputStream`.
-> m DataStreamByteOrder | Returns: the `DataStreamByteOrder` for the `stream`.

Gets the byte order for the stream.

## new

dataOutputStreamNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsOutputStream a) |
=> a | `baseStream`: a `OutputStream`.
-> m DataOutputStream | Returns: `DataOutputStream`.

Creates a new data output stream for `baseStream`.

## putByte

dataOutputStreamPutByte Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Word8 | `data`: a `guchar`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts a byte into the output stream.

## putInt16

dataOutputStreamPutInt16 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Int16 | `data`: a `gint16`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts a signed 16-bit integer into the output stream.

## putInt32

dataOutputStreamPutInt32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Int32 | `data`: a `gint32`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts a signed 32-bit integer into the output stream.

## putInt64

dataOutputStreamPutInt64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Int64 | `data`: a `gint64`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts a signed 64-bit integer into the stream.

## putString

dataOutputStreamPutString Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Text | `str`: a string.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts a string into the output stream.

## putUint16

dataOutputStreamPutUint16 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Word16 | `data`: a `guint16`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts an unsigned 16-bit integer into the output stream.

## putUint32

dataOutputStreamPutUint32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Word32 | `data`: a `guint32`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts an unsigned 32-bit integer into the stream.

## putUint64

dataOutputStreamPutUint64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a, IsCancellable b) |
=> a | `stream`: a `DataOutputStream`.
-> Word64 | `data`: a `guint64`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m () | (Can throw `GError`)

Puts an unsigned 64-bit integer into the stream.

## setByteOrder

dataOutputStreamSetByteOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataOutputStream a) |
=> a | `stream`: a `DataOutputStream`.
-> DataStreamByteOrder | `order`: a `GDataStreamByteOrder`.
-> m () |

Sets the byte order of the data output stream to `order`.

# Properties

## byteOrder

Determines the byte ordering that is used when writing multi-byte entities (such as integers) to the stream.

constructDataOutputStreamByteOrder :: (IsDataOutputStream o, MonadIO m) => DataStreamByteOrder -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`byte-order`” property. This is rarely needed directly, but it is used by `new`.

getDataOutputStreamByteOrder :: (MonadIO m, IsDataOutputStream o) => o -> m DataStreamByteOrder Source #

Get the value of the “`byte-order`” property. When overloading is enabled, this is equivalent to

    get dataOutputStream #byteOrder

setDataOutputStreamByteOrder :: (MonadIO m, IsDataOutputStream o) => o -> DataStreamByteOrder -> m () Source #

Set the value of the “`byte-order`” property. When overloading is enabled, this is equivalent to

    set dataOutputStream [ #byteOrder := value ]