gi-gio-2.0.32: 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.DataInputStream

Contents

- Exported types
- Methods
  - getByteOrder
  - getNewlineType
  - new
  - readByte
  - readInt16
  - readInt32
  - readInt64
  - readLine
  - readLineAsync
  - readLineFinish
  - readLineFinishUtf8
  - readLineUtf8
  - readUint16
  - readUint32
  - readUint64
  - readUntil
  - readUntilAsync
  - readUntilFinish
  - readUpto
  - readUptoAsync
  - readUptoFinish
  - setByteOrder
  - setNewlineType
- Properties
  - byteOrder
  - newlineType

Description

Data input stream implements `InputStream` and includes functions for reading structured data directly from a binary input stream.

Synopsis

- newtype DataInputStream = DataInputStream (ManagedPtr DataInputStream)
- class (GObject o, IsDescendantOf DataInputStream o) => IsDataInputStream o
- toDataInputStream :: (MonadIO m, IsDataInputStream o) => o -> m DataInputStream
- dataInputStreamGetByteOrder :: (HasCallStack, MonadIO m, IsDataInputStream a) => a -> m DataStreamByteOrder
- dataInputStreamGetNewlineType :: (HasCallStack, MonadIO m, IsDataInputStream a) => a -> m DataStreamNewlineType
- dataInputStreamNew :: (HasCallStack, MonadIO m, IsInputStream a) => a -> m DataInputStream
- dataInputStreamReadByte :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Word8
- dataInputStreamReadInt16 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Int16
- dataInputStreamReadInt32 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Int32
- dataInputStreamReadInt64 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Int64
- dataInputStreamReadLine :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m (Maybe ByteString, Word64)
- dataInputStreamReadLineAsync :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- dataInputStreamReadLineFinish :: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) => a -> b -> m (Maybe ByteString, Word64)
- dataInputStreamReadLineFinishUtf8 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) => a -> b -> m (Maybe Text, Word64)
- dataInputStreamReadLineUtf8 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m (Maybe Text, Word64)
- dataInputStreamReadUint16 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Word16
- dataInputStreamReadUint32 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Word32
- dataInputStreamReadUint64 :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Maybe b -> m Word64
- dataInputStreamReadUntil :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Text -> Maybe b -> m (Text, Word64)
- dataInputStreamReadUntilAsync :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- dataInputStreamReadUntilFinish :: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) => a -> b -> m (Text, Word64)
- dataInputStreamReadUpto :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Text -> Int64 -> Maybe b -> m (Text, Word64)
- dataInputStreamReadUptoAsync :: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) => a -> Text -> Int64 -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- dataInputStreamReadUptoFinish :: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) => a -> b -> m (Text, Word64)
- dataInputStreamSetByteOrder :: (HasCallStack, MonadIO m, IsDataInputStream a) => a -> DataStreamByteOrder -> m ()
- dataInputStreamSetNewlineType :: (HasCallStack, MonadIO m, IsDataInputStream a) => a -> DataStreamNewlineType -> m ()
- constructDataInputStreamByteOrder :: (IsDataInputStream o, MonadIO m) => DataStreamByteOrder -> m (GValueConstruct o)
- getDataInputStreamByteOrder :: (MonadIO m, IsDataInputStream o) => o -> m DataStreamByteOrder
- setDataInputStreamByteOrder :: (MonadIO m, IsDataInputStream o) => o -> DataStreamByteOrder -> m ()
- constructDataInputStreamNewlineType :: (IsDataInputStream o, MonadIO m) => DataStreamNewlineType -> m (GValueConstruct o)
- getDataInputStreamNewlineType :: (MonadIO m, IsDataInputStream o) => o -> m DataStreamNewlineType
- setDataInputStreamNewlineType :: (MonadIO m, IsDataInputStream o) => o -> DataStreamNewlineType -> m ()

# Exported types

newtype DataInputStream Source #

Memory-managed wrapper type.

Constructors

DataInputStream (ManagedPtr DataInputStream) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf DataInputStream o) => IsDataInputStream o Source #

Type class for types which can be safely cast to `DataInputStream`, for instance with `toDataInputStream`.

#### Instances

Instances details

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

toDataInputStream :: (MonadIO m, IsDataInputStream o) => o -> m DataInputStream Source #

Cast to `DataInputStream`, 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

bindProperty, bindPropertyFull, canSeek, canTruncate, clearPending, close, closeAsync, closeFinish, fill, fillAsync, fillFinish, forceFloating, freezeNotify, getv, hasPending, isClosed, isFloating, notify, notifyByPspec, peek, peekBuffer, read, readAll, readAllAsync, readAllFinish, readAsync, readByte, readBytes, readBytesAsync, readBytesFinish, readFinish, readInt16, readInt32, readInt64, readLine, readLineAsync, readLineFinish, readLineFinishUtf8, readLineUtf8, readUint16, readUint32, readUint64, readUntil, readUntilAsync, readUntilFinish, readUpto, readUptoAsync, readUptoFinish, ref, refSink, runDispose, seek, skip, skipAsync, skipFinish, stealData, stealQdata, tell, thawNotify, truncate, unref, watchClosure.

#### Getters

getAvailable, getBaseStream, getBufferSize, getByteOrder, getCloseBaseStream, getData, getNewlineType, getProperty, getQdata.

#### Setters

setBufferSize, setByteOrder, setCloseBaseStream, setData, setDataFull, setNewlineType, setPending, setProperty.

## getByteOrder

dataInputStreamGetByteOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a) |
=> a | `stream`: a given `DataInputStream`.
-> m DataStreamByteOrder | Returns: the `stream`'s current `DataStreamByteOrder`.

Gets the byte order for the data input stream.

## getNewlineType

dataInputStreamGetNewlineType Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a) |
=> a | `stream`: a given `DataInputStream`.
-> m DataStreamNewlineType | Returns: `DataStreamNewlineType` for the given `stream`.

Gets the current newline type for the `stream`.

## new

dataInputStreamNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsInputStream a) |
=> a | `baseStream`: a `InputStream`.
-> m DataInputStream | Returns: a new `DataInputStream`.

Creates a new data input stream for the `baseStream`.

## readByte

dataInputStreamReadByte Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Word8 | Returns: an unsigned 8-bit/1-byte value read from the `stream` or `0` if an error occurred. (Can throw `GError`)

Reads an unsigned 8-bit/1-byte value from `stream`.

## readInt16

dataInputStreamReadInt16 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Int16 | Returns: a signed 16-bit/2-byte value read from `stream` or `0` if an error occurred. (Can throw `GError`)

Reads a 16-bit/2-byte value from `stream`.

In order to get the correct byte order for this read operation, see `dataInputStreamGetByteOrder` and `dataInputStreamSetByteOrder`.

## readInt32

dataInputStreamReadInt32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Int32 | Returns: a signed 32-bit/4-byte value read from the `stream` or `0` if an error occurred. (Can throw `GError`)

Reads a signed 32-bit/4-byte value from `stream`.

In order to get the correct byte order for this read operation, see `dataInputStreamGetByteOrder` and `dataInputStreamSetByteOrder`.

If `cancellable` is not `Nothing`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `IOErrorEnumCancelled` will be returned.

## readInt64

dataInputStreamReadInt64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Int64 | Returns: a signed 64-bit/8-byte value read from `stream` or `0` if an error occurred. (Can throw `GError`)

Reads a 64-bit/8-byte value from `stream`.

In order to get the correct byte order for this read operation, see `dataInputStreamGetByteOrder` and `dataInputStreamSetByteOrder`.

If `cancellable` is not `Nothing`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `IOErrorEnumCancelled` will be returned.

## readLine

dataInputStreamReadLine Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m (Maybe ByteString, Word64) | Returns: a NUL terminated byte array with the line that was read in (without the newlines). Set `length` to a `gsize` to get the length of the read line. On an error, it will return `Nothing` and `error` will be set. If there's no content to read, it will still return `Nothing`, but `error` won't be set. (Can throw `GError`)

Reads a line from the data input stream. Note that no encoding checks or conversion is performed; the input is not guaranteed to be UTF-8, and may in fact have embedded NUL characters.

If `cancellable` is not `Nothing`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `IOErrorEnumCancelled` will be returned.

## readLineAsync

dataInputStreamReadLineAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Int32 | `ioPriority`: the [I/O priority][io-priority] of the request
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> Maybe AsyncReadyCallback | `callback`: callback to call when the request is satisfied.
-> m () |

The asynchronous version of `dataInputStreamReadLine`. It is an error to have two outstanding calls to this function.

When the operation is finished, `callback` will be called. You can then call `dataInputStreamReadLineFinish` to get the result of the operation.

Since: 2.20

## readLineFinish

dataInputStreamReadLineFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) |
=> a | `stream`: a given `DataInputStream`.
-> b | `result`: the `AsyncResult` that was provided to the callback.
-> m (Maybe ByteString, Word64) | Returns: a NUL-terminated byte array with the line that was read in (without the newlines). Set `length` to a `gsize` to get the length of the read line. On an error, it will return `Nothing` and `error` will be set. If there's no content to read, it will still return `Nothing`, but `error` won't be set. (Can throw `GError`)

Finish an asynchronous call started by `dataInputStreamReadLineAsync`. Note the warning about string encoding in `dataInputStreamReadLine` applies here as well.

Since: 2.20

## readLineFinishUtf8

dataInputStreamReadLineFinishUtf8 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) |
=> a | `stream`: a given `DataInputStream`.
-> b | `result`: the `AsyncResult` that was provided to the callback.

-> m (Maybe Text, Word64)

Returns: a string with the line that was read in (without the newlines). Set `length` to a `gsize` to get the length of the read line. On an error, it will return `Nothing` and `error` will be set. For UTF-8 conversion errors, the set error domain is `G_CONVERT_ERROR`. If there's no content to read, it will still return `Nothing`, but `error` won't be set. (Can throw `GError`)

Finish an asynchronous call started by `dataInputStreamReadLineAsync`.

Since: 2.30

## readLineUtf8

dataInputStreamReadLineUtf8 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.

-> m (Maybe Text, Word64)

Returns: a NUL terminated UTF-8 string with the line that was read in (without the newlines). Set `length` to a `gsize` to get the length of the read line. On an error, it will return `Nothing` and `error` will be set. For UTF-8 conversion errors, the set error domain is `G_CONVERT_ERROR`. If there's no content to read, it will still return `Nothing`, but `error` won't be set. (Can throw `GError`)

Reads a UTF-8 encoded line from the data input stream.

If `cancellable` is not `Nothing`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `IOErrorEnumCancelled` will be returned.

Since: 2.30

## readUint16

dataInputStreamReadUint16 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Word16 | Returns: an unsigned 16-bit/2-byte value read from the `stream` or `0` if an error occurred. (Can throw `GError`)

Reads an unsigned 16-bit/2-byte value from `stream`.

In order to get the correct byte order for this read operation, see `dataInputStreamGetByteOrder` and `dataInputStreamSetByteOrder`.

## readUint32

dataInputStreamReadUint32 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Word32 | Returns: an unsigned 32-bit/4-byte value read from the `stream` or `0` if an error occurred. (Can throw `GError`)

Reads an unsigned 32-bit/4-byte value from `stream`.

In order to get the correct byte order for this read operation, see `dataInputStreamGetByteOrder` and `dataInputStreamSetByteOrder`.

If `cancellable` is not `Nothing`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `IOErrorEnumCancelled` will be returned.

## readUint64

dataInputStreamReadUint64 Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m Word64 | Returns: an unsigned 64-bit/8-byte read from `stream` or `0` if an error occurred. (Can throw `GError`)

Reads an unsigned 64-bit/8-byte value from `stream`.

In order to get the correct byte order for this read operation, see `dataInputStreamGetByteOrder`.

If `cancellable` is not `Nothing`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `IOErrorEnumCancelled` will be returned.

## readUntil

dataInputStreamReadUntil Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Text | `stopChars`: characters to terminate the read.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m (Text, Word64) | Returns: a string with the data that was read before encountering any of the stop characters. Set `length` to a `gsize` to get the length of the string. This function will return `Nothing` on an error. (Can throw `GError`)

Deprecated: (Since version 2.56)Use `dataInputStreamReadUpto` instead, which has more consistent behaviour regarding the stop character.

Reads a string from the data input stream, up to the first occurrence of any of the stop characters.

Note that, in contrast to `dataInputStreamReadUntilAsync`, this function consumes the stop character that it finds.

Don't use this function in new code. Its functionality is inconsistent with `dataInputStreamReadUntilAsync`. Both functions will be marked as deprecated in a future release. Use `dataInputStreamReadUpto` instead, but note that that function does not consume the stop character.

## readUntilAsync

dataInputStreamReadUntilAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a given `DataInputStream`.
-> Text | `stopChars`: characters to terminate the read.
-> Int32 | `ioPriority`: the [I/O priority][io-priority] of the request
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> Maybe AsyncReadyCallback | `callback`: callback to call when the request is satisfied.
-> m () |

Deprecated: (Since version 2.56)Use `dataInputStreamReadUptoAsync` instead, which has more consistent behaviour regarding the stop character.

The asynchronous version of `dataInputStreamReadUntil`. It is an error to have two outstanding calls to this function.

Note that, in contrast to `dataInputStreamReadUntil`, this function does not consume the stop character that it finds. You must read it for yourself.

When the operation is finished, `callback` will be called. You can then call `dataInputStreamReadUntilFinish` to get the result of the operation.

Don't use this function in new code. Its functionality is inconsistent with `dataInputStreamReadUntil`. Both functions will be marked as deprecated in a future release. Use `dataInputStreamReadUptoAsync` instead.

Since: 2.20

## readUntilFinish

dataInputStreamReadUntilFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) |
=> a | `stream`: a given `DataInputStream`.
-> b | `result`: the `AsyncResult` that was provided to the callback.
-> m (Text, Word64) | Returns: a string with the data that was read before encountering any of the stop characters. Set `length` to a `gsize` to get the length of the string. This function will return `Nothing` on an error. (Can throw `GError`)

Deprecated: (Since version 2.56)Use `dataInputStreamReadUptoFinish` instead, which has more consistent behaviour regarding the stop character.

Finish an asynchronous call started by `dataInputStreamReadUntilAsync`.

Since: 2.20

## readUpto

dataInputStreamReadUpto Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a `DataInputStream`
-> Text | `stopChars`: characters to terminate the read
-> Int64 | `stopCharsLen`: length of `stopChars`. May be -1 if `stopChars` is nul-terminated
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore
-> m (Text, Word64) | Returns: a string with the data that was read before encountering any of the stop characters. Set `length` to a `gsize` to get the length of the string. This function will return `Nothing` on an error (Can throw `GError`)

Reads a string from the data input stream, up to the first occurrence of any of the stop characters.

In contrast to `dataInputStreamReadUntil`, this function does not consume the stop character. You have to use `dataInputStreamReadByte` to get it before calling `dataInputStreamReadUpto` again.

Note that `stopChars` may contain '\0' if `stopCharsLen` is specified.

The returned string will always be nul-terminated on success.

Since: 2.26

## readUptoAsync

dataInputStreamReadUptoAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsCancellable b) |
=> a | `stream`: a `DataInputStream`
-> Text | `stopChars`: characters to terminate the read
-> Int64 | `stopCharsLen`: length of `stopChars`. May be -1 if `stopChars` is nul-terminated
-> Int32 | `ioPriority`: the [I/O priority][io-priority] of the request
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore
-> Maybe AsyncReadyCallback | `callback`: callback to call when the request is satisfied
-> m () |

The asynchronous version of `dataInputStreamReadUpto`. It is an error to have two outstanding calls to this function.

In contrast to `dataInputStreamReadUntil`, this function does not consume the stop character. You have to use `dataInputStreamReadByte` to get it before calling `dataInputStreamReadUpto` again.

Note that `stopChars` may contain '\0' if `stopCharsLen` is specified.

When the operation is finished, `callback` will be called. You can then call `dataInputStreamReadUptoFinish` to get the result of the operation.

Since: 2.26

## readUptoFinish

dataInputStreamReadUptoFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a, IsAsyncResult b) |
=> a | `stream`: a `DataInputStream`
-> b | `result`: the `AsyncResult` that was provided to the callback
-> m (Text, Word64) | Returns: a string with the data that was read before encountering any of the stop characters. Set `length` to a `gsize` to get the length of the string. This function will return `Nothing` on an error. (Can throw `GError`)

Finish an asynchronous call started by `dataInputStreamReadUptoAsync`.

Note that this function does not consume the stop character. You have to use `dataInputStreamReadByte` to get it before calling `dataInputStreamReadUptoAsync` again.

The returned string will always be nul-terminated on success.

Since: 2.24

## setByteOrder

dataInputStreamSetByteOrder Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a) |
=> a | `stream`: a given `DataInputStream`.
-> DataStreamByteOrder | `order`: a `DataStreamByteOrder` to set.
-> m () |

This function sets the byte order for the given `stream`. All subsequent reads from the `stream` will be read in the given `order`.

## setNewlineType

dataInputStreamSetNewlineType Source #

Arguments

:: (HasCallStack, MonadIO m, IsDataInputStream a) |
=> a | `stream`: a `DataInputStream`.
-> DataStreamNewlineType | `type`: the type of new line return as `DataStreamNewlineType`.
-> m () |

Sets the newline type for the `stream`.

Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read chunk ends in "CR" we must read an additional byte to know if this is "CR" or "CR LF", and this might block if there is no more data available.

# Properties

## byteOrder

The :byte-order property determines the byte ordering that is used when reading multi-byte entities (such as integers) from the stream.

constructDataInputStreamByteOrder :: (IsDataInputStream 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`.

getDataInputStreamByteOrder :: (MonadIO m, IsDataInputStream o) => o -> m DataStreamByteOrder Source #

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

    get dataInputStream #byteOrder

setDataInputStreamByteOrder :: (MonadIO m, IsDataInputStream o) => o -> DataStreamByteOrder -> m () Source #

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

    set dataInputStream [ #byteOrder := value ]

## newlineType

The :newline-type property determines what is considered as a line ending when reading complete lines from the stream.

constructDataInputStreamNewlineType :: (IsDataInputStream o, MonadIO m) => DataStreamNewlineType -> m (GValueConstruct o) Source #

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

getDataInputStreamNewlineType :: (MonadIO m, IsDataInputStream o) => o -> m DataStreamNewlineType Source #

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

    get dataInputStream #newlineType

setDataInputStreamNewlineType :: (MonadIO m, IsDataInputStream o) => o -> DataStreamNewlineType -> m () Source #

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

    set dataInputStream [ #newlineType := value ]