{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

Data output stream implements 'GI.Gio.Objects.OutputStream.OutputStream' and includes functions for
writing data directly to an output stream.
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.Gio.Objects.DataOutputStream
    (

-- * Exported types
    DataOutputStream(..)                    ,
    IsDataOutputStream                      ,
    toDataOutputStream                      ,
    noDataOutputStream                      ,


 -- * Methods
-- ** getByteOrder #method:getByteOrder#

#if ENABLE_OVERLOADING
    DataOutputStreamGetByteOrderMethodInfo  ,
#endif
    dataOutputStreamGetByteOrder            ,


-- ** new #method:new#

    dataOutputStreamNew                     ,


-- ** putByte #method:putByte#

#if ENABLE_OVERLOADING
    DataOutputStreamPutByteMethodInfo       ,
#endif
    dataOutputStreamPutByte                 ,


-- ** putInt16 #method:putInt16#

#if ENABLE_OVERLOADING
    DataOutputStreamPutInt16MethodInfo      ,
#endif
    dataOutputStreamPutInt16                ,


-- ** putInt32 #method:putInt32#

#if ENABLE_OVERLOADING
    DataOutputStreamPutInt32MethodInfo      ,
#endif
    dataOutputStreamPutInt32                ,


-- ** putInt64 #method:putInt64#

#if ENABLE_OVERLOADING
    DataOutputStreamPutInt64MethodInfo      ,
#endif
    dataOutputStreamPutInt64                ,


-- ** putString #method:putString#

#if ENABLE_OVERLOADING
    DataOutputStreamPutStringMethodInfo     ,
#endif
    dataOutputStreamPutString               ,


-- ** putUint16 #method:putUint16#

#if ENABLE_OVERLOADING
    DataOutputStreamPutUint16MethodInfo     ,
#endif
    dataOutputStreamPutUint16               ,


-- ** putUint32 #method:putUint32#

#if ENABLE_OVERLOADING
    DataOutputStreamPutUint32MethodInfo     ,
#endif
    dataOutputStreamPutUint32               ,


-- ** putUint64 #method:putUint64#

#if ENABLE_OVERLOADING
    DataOutputStreamPutUint64MethodInfo     ,
#endif
    dataOutputStreamPutUint64               ,


-- ** setByteOrder #method:setByteOrder#

#if ENABLE_OVERLOADING
    DataOutputStreamSetByteOrderMethodInfo  ,
#endif
    dataOutputStreamSetByteOrder            ,




 -- * Properties
-- ** byteOrder #attr:byteOrder#
{- | Determines the byte ordering that is used when writing
multi-byte entities (such as integers) to the stream.
-}
#if ENABLE_OVERLOADING
    DataOutputStreamByteOrderPropertyInfo   ,
#endif
    constructDataOutputStreamByteOrder      ,
#if ENABLE_OVERLOADING
    dataOutputStreamByteOrder               ,
#endif
    getDataOutputStreamByteOrder            ,
    setDataOutputStreamByteOrder            ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FilterOutputStream as Gio.FilterOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream

-- | Memory-managed wrapper type.
newtype DataOutputStream = DataOutputStream (ManagedPtr DataOutputStream)
foreign import ccall "g_data_output_stream_get_type"
    c_g_data_output_stream_get_type :: IO GType

instance GObject DataOutputStream where
    gobjectType _ = c_g_data_output_stream_get_type


-- | Type class for types which can be safely cast to `DataOutputStream`, for instance with `toDataOutputStream`.
class GObject o => IsDataOutputStream o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DataOutputStream a) =>
    IsDataOutputStream a
#endif
instance IsDataOutputStream DataOutputStream
instance Gio.FilterOutputStream.IsFilterOutputStream DataOutputStream
instance Gio.OutputStream.IsOutputStream DataOutputStream
instance GObject.Object.IsObject DataOutputStream
instance Gio.Seekable.IsSeekable DataOutputStream

-- | Cast to `DataOutputStream`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDataOutputStream :: (MonadIO m, IsDataOutputStream o) => o -> m DataOutputStream
toDataOutputStream = liftIO . unsafeCastTo DataOutputStream

-- | A convenience alias for `Nothing` :: `Maybe` `DataOutputStream`.
noDataOutputStream :: Maybe DataOutputStream
noDataOutputStream = Nothing

#if ENABLE_OVERLOADING
type family ResolveDataOutputStreamMethod (t :: Symbol) (o :: *) :: * where
    ResolveDataOutputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDataOutputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDataOutputStreamMethod "canSeek" o = Gio.Seekable.SeekableCanSeekMethodInfo
    ResolveDataOutputStreamMethod "canTruncate" o = Gio.Seekable.SeekableCanTruncateMethodInfo
    ResolveDataOutputStreamMethod "clearPending" o = Gio.OutputStream.OutputStreamClearPendingMethodInfo
    ResolveDataOutputStreamMethod "close" o = Gio.OutputStream.OutputStreamCloseMethodInfo
    ResolveDataOutputStreamMethod "closeAsync" o = Gio.OutputStream.OutputStreamCloseAsyncMethodInfo
    ResolveDataOutputStreamMethod "closeFinish" o = Gio.OutputStream.OutputStreamCloseFinishMethodInfo
    ResolveDataOutputStreamMethod "flush" o = Gio.OutputStream.OutputStreamFlushMethodInfo
    ResolveDataOutputStreamMethod "flushAsync" o = Gio.OutputStream.OutputStreamFlushAsyncMethodInfo
    ResolveDataOutputStreamMethod "flushFinish" o = Gio.OutputStream.OutputStreamFlushFinishMethodInfo
    ResolveDataOutputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDataOutputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDataOutputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDataOutputStreamMethod "hasPending" o = Gio.OutputStream.OutputStreamHasPendingMethodInfo
    ResolveDataOutputStreamMethod "isClosed" o = Gio.OutputStream.OutputStreamIsClosedMethodInfo
    ResolveDataOutputStreamMethod "isClosing" o = Gio.OutputStream.OutputStreamIsClosingMethodInfo
    ResolveDataOutputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDataOutputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDataOutputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDataOutputStreamMethod "putByte" o = DataOutputStreamPutByteMethodInfo
    ResolveDataOutputStreamMethod "putInt16" o = DataOutputStreamPutInt16MethodInfo
    ResolveDataOutputStreamMethod "putInt32" o = DataOutputStreamPutInt32MethodInfo
    ResolveDataOutputStreamMethod "putInt64" o = DataOutputStreamPutInt64MethodInfo
    ResolveDataOutputStreamMethod "putString" o = DataOutputStreamPutStringMethodInfo
    ResolveDataOutputStreamMethod "putUint16" o = DataOutputStreamPutUint16MethodInfo
    ResolveDataOutputStreamMethod "putUint32" o = DataOutputStreamPutUint32MethodInfo
    ResolveDataOutputStreamMethod "putUint64" o = DataOutputStreamPutUint64MethodInfo
    ResolveDataOutputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDataOutputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDataOutputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDataOutputStreamMethod "seek" o = Gio.Seekable.SeekableSeekMethodInfo
    ResolveDataOutputStreamMethod "splice" o = Gio.OutputStream.OutputStreamSpliceMethodInfo
    ResolveDataOutputStreamMethod "spliceAsync" o = Gio.OutputStream.OutputStreamSpliceAsyncMethodInfo
    ResolveDataOutputStreamMethod "spliceFinish" o = Gio.OutputStream.OutputStreamSpliceFinishMethodInfo
    ResolveDataOutputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDataOutputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDataOutputStreamMethod "tell" o = Gio.Seekable.SeekableTellMethodInfo
    ResolveDataOutputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDataOutputStreamMethod "truncate" o = Gio.Seekable.SeekableTruncateMethodInfo
    ResolveDataOutputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDataOutputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDataOutputStreamMethod "write" o = Gio.OutputStream.OutputStreamWriteMethodInfo
    ResolveDataOutputStreamMethod "writeAll" o = Gio.OutputStream.OutputStreamWriteAllMethodInfo
    ResolveDataOutputStreamMethod "writeAllAsync" o = Gio.OutputStream.OutputStreamWriteAllAsyncMethodInfo
    ResolveDataOutputStreamMethod "writeAllFinish" o = Gio.OutputStream.OutputStreamWriteAllFinishMethodInfo
    ResolveDataOutputStreamMethod "writeAsync" o = Gio.OutputStream.OutputStreamWriteAsyncMethodInfo
    ResolveDataOutputStreamMethod "writeBytes" o = Gio.OutputStream.OutputStreamWriteBytesMethodInfo
    ResolveDataOutputStreamMethod "writeBytesAsync" o = Gio.OutputStream.OutputStreamWriteBytesAsyncMethodInfo
    ResolveDataOutputStreamMethod "writeBytesFinish" o = Gio.OutputStream.OutputStreamWriteBytesFinishMethodInfo
    ResolveDataOutputStreamMethod "writeFinish" o = Gio.OutputStream.OutputStreamWriteFinishMethodInfo
    ResolveDataOutputStreamMethod "getBaseStream" o = Gio.FilterOutputStream.FilterOutputStreamGetBaseStreamMethodInfo
    ResolveDataOutputStreamMethod "getByteOrder" o = DataOutputStreamGetByteOrderMethodInfo
    ResolveDataOutputStreamMethod "getCloseBaseStream" o = Gio.FilterOutputStream.FilterOutputStreamGetCloseBaseStreamMethodInfo
    ResolveDataOutputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDataOutputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDataOutputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDataOutputStreamMethod "setByteOrder" o = DataOutputStreamSetByteOrderMethodInfo
    ResolveDataOutputStreamMethod "setCloseBaseStream" o = Gio.FilterOutputStream.FilterOutputStreamSetCloseBaseStreamMethodInfo
    ResolveDataOutputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDataOutputStreamMethod "setPending" o = Gio.OutputStream.OutputStreamSetPendingMethodInfo
    ResolveDataOutputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDataOutputStreamMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDataOutputStreamMethod t DataOutputStream, O.MethodInfo info DataOutputStream p) => O.IsLabelProxy t (DataOutputStream -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDataOutputStreamMethod t DataOutputStream, O.MethodInfo info DataOutputStream p) => O.IsLabel t (DataOutputStream -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

-- VVV Prop "byte-order"
   -- Type: TInterface (Name {namespace = "Gio", name = "DataStreamByteOrder"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@byte-order@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dataOutputStream #byteOrder
@
-}
getDataOutputStreamByteOrder :: (MonadIO m, IsDataOutputStream o) => o -> m Gio.Enums.DataStreamByteOrder
getDataOutputStreamByteOrder obj = liftIO $ getObjectPropertyEnum obj "byte-order"

{- |
Set the value of the “@byte-order@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' dataOutputStream [ #byteOrder 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDataOutputStreamByteOrder :: (MonadIO m, IsDataOutputStream o) => o -> Gio.Enums.DataStreamByteOrder -> m ()
setDataOutputStreamByteOrder obj val = liftIO $ setObjectPropertyEnum obj "byte-order" val

{- |
Construct a `GValueConstruct` with valid value for the “@byte-order@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDataOutputStreamByteOrder :: (IsDataOutputStream o) => Gio.Enums.DataStreamByteOrder -> IO (GValueConstruct o)
constructDataOutputStreamByteOrder val = constructObjectPropertyEnum "byte-order" val

#if ENABLE_OVERLOADING
data DataOutputStreamByteOrderPropertyInfo
instance AttrInfo DataOutputStreamByteOrderPropertyInfo where
    type AttrAllowedOps DataOutputStreamByteOrderPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DataOutputStreamByteOrderPropertyInfo = (~) Gio.Enums.DataStreamByteOrder
    type AttrBaseTypeConstraint DataOutputStreamByteOrderPropertyInfo = IsDataOutputStream
    type AttrGetType DataOutputStreamByteOrderPropertyInfo = Gio.Enums.DataStreamByteOrder
    type AttrLabel DataOutputStreamByteOrderPropertyInfo = "byte-order"
    type AttrOrigin DataOutputStreamByteOrderPropertyInfo = DataOutputStream
    attrGet _ = getDataOutputStreamByteOrder
    attrSet _ = setDataOutputStreamByteOrder
    attrConstruct _ = constructDataOutputStreamByteOrder
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList DataOutputStream
type instance O.AttributeList DataOutputStream = DataOutputStreamAttributeList
type DataOutputStreamAttributeList = ('[ '("baseStream", Gio.FilterOutputStream.FilterOutputStreamBaseStreamPropertyInfo), '("byteOrder", DataOutputStreamByteOrderPropertyInfo), '("closeBaseStream", Gio.FilterOutputStream.FilterOutputStreamCloseBaseStreamPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
dataOutputStreamByteOrder :: AttrLabelProxy "byteOrder"
dataOutputStreamByteOrder = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
type instance O.SignalList DataOutputStream = DataOutputStreamSignalList
type DataOutputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method DataOutputStream::new
-- method type : Constructor
-- Args : [Arg {argCName = "base_stream", argType = TInterface (Name {namespace = "Gio", name = "OutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DataOutputStream"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_data_output_stream_new" g_data_output_stream_new ::
    Ptr Gio.OutputStream.OutputStream ->    -- base_stream : TInterface (Name {namespace = "Gio", name = "OutputStream"})
    IO (Ptr DataOutputStream)

{- |
Creates a new data output stream for /@baseStream@/.
-}
dataOutputStreamNew ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.OutputStream.IsOutputStream a) =>
    a
    {- ^ /@baseStream@/: a 'GI.Gio.Objects.OutputStream.OutputStream'. -}
    -> m DataOutputStream
    {- ^ __Returns:__ 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
dataOutputStreamNew baseStream = liftIO $ do
    baseStream' <- unsafeManagedPtrCastPtr baseStream
    result <- g_data_output_stream_new baseStream'
    checkUnexpectedReturnNULL "dataOutputStreamNew" result
    result' <- (wrapObject DataOutputStream) result
    touchManagedPtr baseStream
    return result'

#if ENABLE_OVERLOADING
#endif

-- method DataOutputStream::get_byte_order
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DataStreamByteOrder"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_data_output_stream_get_byte_order" g_data_output_stream_get_byte_order ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    IO CUInt

{- |
Gets the byte order for the stream.
-}
dataOutputStreamGetByteOrder ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> m Gio.Enums.DataStreamByteOrder
    {- ^ __Returns:__ the 'GI.Gio.Enums.DataStreamByteOrder' for the /@stream@/. -}
dataOutputStreamGetByteOrder stream = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    result <- g_data_output_stream_get_byte_order stream'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr stream
    return result'

#if ENABLE_OVERLOADING
data DataOutputStreamGetByteOrderMethodInfo
instance (signature ~ (m Gio.Enums.DataStreamByteOrder), MonadIO m, IsDataOutputStream a) => O.MethodInfo DataOutputStreamGetByteOrderMethodInfo a signature where
    overloadedMethod _ = dataOutputStreamGetByteOrder

#endif

-- method DataOutputStream::put_byte
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TUInt8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #guchar.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_byte" g_data_output_stream_put_byte ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Word8 ->                                -- data : TBasicType TUInt8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts a byte into the output stream.
-}
dataOutputStreamPutByte ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Word8
    {- ^ /@data@/: a @/guchar/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutByte stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_byte stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutByteMethodInfo
instance (signature ~ (Word8 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutByteMethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutByte

#endif

-- method DataOutputStream::put_int16
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #gint16.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_int16" g_data_output_stream_put_int16 ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Int16 ->                                -- data : TBasicType TInt16
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts a signed 16-bit integer into the output stream.
-}
dataOutputStreamPutInt16 ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Int16
    {- ^ /@data@/: a @/gint16/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutInt16 stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_int16 stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutInt16MethodInfo
instance (signature ~ (Int16 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutInt16MethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutInt16

#endif

-- method DataOutputStream::put_int32
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #gint32.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_int32" g_data_output_stream_put_int32 ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Int32 ->                                -- data : TBasicType TInt32
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts a signed 32-bit integer into the output stream.
-}
dataOutputStreamPutInt32 ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Int32
    {- ^ /@data@/: a @/gint32/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutInt32 stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_int32 stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutInt32MethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutInt32MethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutInt32

#endif

-- method DataOutputStream::put_int64
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #gint64.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_int64" g_data_output_stream_put_int64 ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Int64 ->                                -- data : TBasicType TInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts a signed 64-bit integer into the stream.
-}
dataOutputStreamPutInt64 ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Int64
    {- ^ /@data@/: a @/gint64/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutInt64 stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_int64 stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutInt64MethodInfo
instance (signature ~ (Int64 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutInt64MethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutInt64

#endif

-- method DataOutputStream::put_string
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "str", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a string.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_string" g_data_output_stream_put_string ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    CString ->                              -- str : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts a string into the output stream.
-}
dataOutputStreamPutString ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> T.Text
    {- ^ /@str@/: a string. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutString stream str cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    str' <- textToCString str
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_string stream' str' maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        freeMem str'
        return ()
     ) (do
        freeMem str'
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutStringMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutStringMethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutString

#endif

-- method DataOutputStream::put_uint16
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #guint16.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_uint16" g_data_output_stream_put_uint16 ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Word16 ->                               -- data : TBasicType TUInt16
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts an unsigned 16-bit integer into the output stream.
-}
dataOutputStreamPutUint16 ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Word16
    {- ^ /@data@/: a @/guint16/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutUint16 stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_uint16 stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutUint16MethodInfo
instance (signature ~ (Word16 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutUint16MethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutUint16

#endif

-- method DataOutputStream::put_uint32
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #guint32.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_uint32" g_data_output_stream_put_uint32 ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Word32 ->                               -- data : TBasicType TUInt32
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts an unsigned 32-bit integer into the stream.
-}
dataOutputStreamPutUint32 ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Word32
    {- ^ /@data@/: a @/guint32/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutUint32 stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_uint32 stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutUint32MethodInfo
instance (signature ~ (Word32 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutUint32MethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutUint32

#endif

-- method DataOutputStream::put_uint64
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #guint64.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_data_output_stream_put_uint64" g_data_output_stream_put_uint64 ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    Word64 ->                               -- data : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Puts an unsigned 64-bit integer into the stream.
-}
dataOutputStreamPutUint64 ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Word64
    {- ^ /@data@/: a @/guint64/@. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dataOutputStreamPutUint64 stream data_ cancellable = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ g_data_output_stream_put_uint64 stream' data_ maybeCancellable
        touchManagedPtr stream
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DataOutputStreamPutUint64MethodInfo
instance (signature ~ (Word64 -> Maybe (b) -> m ()), MonadIO m, IsDataOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DataOutputStreamPutUint64MethodInfo a signature where
    overloadedMethod _ = dataOutputStreamPutUint64

#endif

-- method DataOutputStream::set_byte_order
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "stream", argType = TInterface (Name {namespace = "Gio", name = "DataOutputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDataOutputStream.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "order", argType = TInterface (Name {namespace = "Gio", name = "DataStreamByteOrder"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a %GDataStreamByteOrder.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_data_output_stream_set_byte_order" g_data_output_stream_set_byte_order ::
    Ptr DataOutputStream ->                 -- stream : TInterface (Name {namespace = "Gio", name = "DataOutputStream"})
    CUInt ->                                -- order : TInterface (Name {namespace = "Gio", name = "DataStreamByteOrder"})
    IO ()

{- |
Sets the byte order of the data output stream to /@order@/.
-}
dataOutputStreamSetByteOrder ::
    (B.CallStack.HasCallStack, MonadIO m, IsDataOutputStream a) =>
    a
    {- ^ /@stream@/: a 'GI.Gio.Objects.DataOutputStream.DataOutputStream'. -}
    -> Gio.Enums.DataStreamByteOrder
    {- ^ /@order@/: a @/GDataStreamByteOrder/@. -}
    -> m ()
dataOutputStreamSetByteOrder stream order = liftIO $ do
    stream' <- unsafeManagedPtrCastPtr stream
    let order' = (fromIntegral . fromEnum) order
    g_data_output_stream_set_byte_order stream' order'
    touchManagedPtr stream
    return ()

#if ENABLE_OVERLOADING
data DataOutputStreamSetByteOrderMethodInfo
instance (signature ~ (Gio.Enums.DataStreamByteOrder -> m ()), MonadIO m, IsDataOutputStream a) => O.MethodInfo DataOutputStreamSetByteOrderMethodInfo a signature where
    overloadedMethod _ = dataOutputStreamSetByteOrder

#endif