packer-0.1.9: Fast byte serializer and unserializer

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell98

Data.Packer.Unsafe

Description

Access to lower primitive that allow to use Packing and Unpacking, on mmap type of memory. Potentially unsafe, as it can't check if any of value passed are valid.

Synopsis

Documentation

runPackingAt Source

Arguments

:: Ptr Word8

Pointer to the beginning of the memory

-> Int

Size of the memory

-> Packing a

Packing action

-> IO (a, Int)

Number of bytes filled

Run packing on an arbitrary buffer with a size.

This is available, for example to run on mmap typed memory, and this is highly unsafe, as the user need to make sure the pointer and size passed to this function are correct.

runUnpackingAt Source

Arguments

:: ForeignPtr Word8

The initial block of memory

-> Int

Starting offset in the block of memory

-> Int

Size

-> Unpacking a

Unpacking action

-> IO a 

Run unpacking on an arbitrary buffer with a size.

This is available, for example to run on mmap typed memory, and this is highly unsafe, as the user need to make sure the pointer and size passed to this function are correct.