gi-gio-2.0.38: Gio bindings

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

GI.Gio.Objects.BufferedOutputStream

Contents

- Exported types
- Methods
  - getAutoGrow
  - getBufferSize
  - new
  - newSized
  - setAutoGrow
  - setBufferSize
- Properties
  - autoGrow
  - bufferSize

Description

Buffered output stream implements `FilterOutputStream` and provides for buffered writes.

By default, `GBufferedOutputStream`'s buffer size is set at 4 kilobytes.

To create a buffered output stream, use `bufferedOutputStreamNew`, or `bufferedOutputStreamNewSized` to specify the buffer's size at construction.

To get the size of a buffer within a buffered input stream, use `bufferedOutputStreamGetBufferSize`. To change the size of a buffered output stream's buffer, use `bufferedOutputStreamSetBufferSize`. Note that the buffer's size cannot be reduced below the size of the data within the buffer.

Synopsis

- newtype BufferedOutputStream = BufferedOutputStream (ManagedPtr BufferedOutputStream)
- class (GObject o, IsDescendantOf BufferedOutputStream o) => IsBufferedOutputStream o
- toBufferedOutputStream :: (MonadIO m, IsBufferedOutputStream o) => o -> m BufferedOutputStream
- bufferedOutputStreamGetAutoGrow :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> m Bool
- bufferedOutputStreamGetBufferSize :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> m CSize
- bufferedOutputStreamNew :: (HasCallStack, MonadIO m, IsOutputStream a) => a -> m BufferedOutputStream
- bufferedOutputStreamNewSized :: (HasCallStack, MonadIO m, IsOutputStream a) => a -> CSize -> m BufferedOutputStream
- bufferedOutputStreamSetAutoGrow :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> Bool -> m ()
- bufferedOutputStreamSetBufferSize :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> CSize -> m ()
- constructBufferedOutputStreamAutoGrow :: (IsBufferedOutputStream o, MonadIO m) => Bool -> m (GValueConstruct o)
- getBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> m Bool
- setBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> Bool -> m ()
- constructBufferedOutputStreamBufferSize :: (IsBufferedOutputStream o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> m Word32
- setBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> Word32 -> m ()

# Exported types

newtype BufferedOutputStream Source #

Memory-managed wrapper type.

Constructors

BufferedOutputStream (ManagedPtr BufferedOutputStream) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf BufferedOutputStream o) => IsBufferedOutputStream o Source #

Type class for types which can be safely cast to `BufferedOutputStream`, for instance with `toBufferedOutputStream`.

#### Instances

Instances details

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

toBufferedOutputStream :: (MonadIO m, IsBufferedOutputStream o) => o -> m BufferedOutputStream Source #

Cast to `BufferedOutputStream`, 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, flush, flushAsync, flushFinish, forceFloating, freezeNotify, getv, hasPending, isClosed, isClosing, isFloating, notify, notifyByPspec, ref, refSink, runDispose, seek, splice, spliceAsync, spliceFinish, stealData, stealQdata, tell, thawNotify, truncate, unref, watchClosure, write, writeAll, writeAllAsync, writeAllFinish, writeAsync, writeBytes, writeBytesAsync, writeBytesFinish, writeFinish, writev, writevAll, writevAllAsync, writevAllFinish, writevAsync, writevFinish.

#### Getters

getAutoGrow, getBaseStream, getBufferSize, getCloseBaseStream, getData, getProperty, getQdata.

#### Setters

setAutoGrow, setBufferSize, setCloseBaseStream, setData, setDataFull, setPending, setProperty.

## getAutoGrow

bufferedOutputStreamGetAutoGrow Source #

Arguments

:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) |
=> a | `stream`: a `BufferedOutputStream`.
-> m Bool | Returns: `TRUE` if the `stream`'s buffer automatically grows, `FALSE` otherwise.

Checks if the buffer automatically grows as data is added.

## getBufferSize

bufferedOutputStreamGetBufferSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) |
=> a | `stream`: a `BufferedOutputStream`.
-> m CSize | Returns: the current size of the buffer.

Gets the size of the buffer in the `stream`.

## new

bufferedOutputStreamNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsOutputStream a) |
=> a | `baseStream`: a `OutputStream`.
-> m BufferedOutputStream | Returns: a `OutputStream` for the given `baseStream`.

Creates a new buffered output stream for a base stream.

## newSized

bufferedOutputStreamNewSized Source #

Arguments

:: (HasCallStack, MonadIO m, IsOutputStream a) |
=> a | `baseStream`: a `OutputStream`.
-> CSize | `size`: a `gsize`.
-> m BufferedOutputStream | Returns: a `OutputStream` with an internal buffer set to `size`.

Creates a new buffered output stream with a given buffer size.

## setAutoGrow

bufferedOutputStreamSetAutoGrow Source #

Arguments

:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) |
=> a | `stream`: a `BufferedOutputStream`.
-> Bool | `autoGrow`: a `Bool`.
-> m () |

Sets whether or not the `stream`'s buffer should automatically grow. If `autoGrow` is true, then each write will just make the buffer larger, and you must manually flush the buffer to actually write out the data to the underlying stream.

## setBufferSize

bufferedOutputStreamSetBufferSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) |
=> a | `stream`: a `BufferedOutputStream`.
-> CSize | `size`: a `gsize`.
-> m () |

Sets the size of the internal buffer to `size`.

# Properties

## autoGrow

Whether the buffer should automatically grow.

constructBufferedOutputStreamAutoGrow :: (IsBufferedOutputStream o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> m Bool Source #

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

    get bufferedOutputStream #autoGrow

setBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> Bool -> m () Source #

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

    set bufferedOutputStream [ #autoGrow := value ]

## bufferSize

The size of the backend buffer, in bytes.

constructBufferedOutputStreamBufferSize :: (IsBufferedOutputStream o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

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

getBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> m Word32 Source #

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

    get bufferedOutputStream #bufferSize

setBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> Word32 -> m () Source #

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

    set bufferedOutputStream [ #bufferSize := value ]