License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unix |
Safe Haskell | None |
Language | Haskell98 |
Synopsis
- data Delta = Delta !Word64 !Word64 ![DeltaCmd]
- data DeltaCmd
- = DeltaCopy !ByteString
- | DeltaSrc !Word64 !Word64
- deltaParse :: Parser Delta
- deltaRead :: [ByteString] -> Maybe Delta
- deltaApply :: ByteString -> Delta -> ByteString
Documentation
a delta is a source size, a destination size and a list of delta cmd
possible commands in a delta
deltaParse :: Parser Delta Source #
parse a delta. format is 2 variable sizes, followed by delta cmds. for each cmd: * if first byte MSB is set, we copy from source. * otherwise, we copy from delta. * extensions are not handled.
deltaApply :: ByteString -> Delta -> ByteString Source #
apply a delta on a lazy bytestring, returning a new bytestring.