Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Buffered output stream implements FilterOutputStream
and provides
for buffered writes.
By default, 'GI.Gio.Objects.BufferedOutputStream.BufferedOutputStream'\'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 => IsBufferedOutputStream o
- toBufferedOutputStream :: (MonadIO m, IsBufferedOutputStream o) => o -> m BufferedOutputStream
- noBufferedOutputStream :: Maybe BufferedOutputStream
- bufferedOutputStreamGetAutoGrow :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> m Bool
- bufferedOutputStreamGetBufferSize :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> m Word64
- bufferedOutputStreamNew :: (HasCallStack, MonadIO m, IsOutputStream a) => a -> m BufferedOutputStream
- bufferedOutputStreamNewSized :: (HasCallStack, MonadIO m, IsOutputStream a) => a -> Word64 -> m BufferedOutputStream
- bufferedOutputStreamSetAutoGrow :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> Bool -> m ()
- bufferedOutputStreamSetBufferSize :: (HasCallStack, MonadIO m, IsBufferedOutputStream a) => a -> Word64 -> m ()
- constructBufferedOutputStreamAutoGrow :: IsBufferedOutputStream o => Bool -> IO (GValueConstruct o)
- getBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> m Bool
- setBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> Bool -> m ()
- constructBufferedOutputStreamBufferSize :: IsBufferedOutputStream o => Word32 -> IO (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.
Instances
class GObject o => IsBufferedOutputStream o Source #
Type class for types which can be safely cast to BufferedOutputStream
, for instance with toBufferedOutputStream
.
Instances
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
.
noBufferedOutputStream :: Maybe BufferedOutputStream Source #
A convenience alias for Nothing
:: Maybe
BufferedOutputStream
.
Methods
getAutoGrow
bufferedOutputStreamGetAutoGrow Source #
:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) | |
=> a |
|
-> m Bool | Returns: |
Checks if the buffer automatically grows as data is added.
getBufferSize
bufferedOutputStreamGetBufferSize Source #
:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) | |
=> a |
|
-> m Word64 | Returns: the current size of the buffer. |
Gets the size of the buffer in the stream
.
new
bufferedOutputStreamNew Source #
:: (HasCallStack, MonadIO m, IsOutputStream a) | |
=> a |
|
-> m BufferedOutputStream | Returns: a |
Creates a new buffered output stream for a base stream.
newSized
bufferedOutputStreamNewSized Source #
:: (HasCallStack, MonadIO m, IsOutputStream a) | |
=> a |
|
-> Word64 |
|
-> m BufferedOutputStream | Returns: a |
Creates a new buffered output stream with a given buffer size.
setAutoGrow
bufferedOutputStreamSetAutoGrow Source #
:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) | |
=> 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 #
:: (HasCallStack, MonadIO m, IsBufferedOutputStream a) | |
=> a |
|
-> Word64 |
|
-> m () |
Sets the size of the internal buffer to size
.
Properties
autoGrow
No description available in the introspection data.
constructBufferedOutputStreamAutoGrow :: IsBufferedOutputStream o => Bool -> IO (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
No description available in the introspection data.
constructBufferedOutputStreamBufferSize :: IsBufferedOutputStream o => Word32 -> IO (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 ]