Safe Haskell | None |
---|---|
Language | Haskell2010 |
- binaryFromStream :: Binary a => InputStream ByteString -> IO (Maybe a)
- binaryInputStream :: Binary a => InputStream ByteString -> IO (InputStream a)
- binaryToStream :: Binary a => OutputStream ByteString -> Maybe a -> IO ()
- binaryOutputStream :: Binary a => OutputStream ByteString -> IO (OutputStream a)
- data DecodeException = DecodeException ByteOffset String
Decoding
binaryFromStream :: Binary a => InputStream ByteString -> IO (Maybe a) Source
Read an instance of Binary
from an InputStream
, throwing a
DecodeException
if the decoding fails.
binaryFromStream
consumes only as much input as necessary:
any unconsumed input is pushed back onto the InputStream
.
binaryInputStream :: Binary a => InputStream ByteString -> IO (InputStream a) Source
Transform an InputStream
over byte strings to an InputStream
yielding
values of type a, throwing a DecodeException
if the decoding fails.
Encoding
binaryToStream :: Binary a => OutputStream ByteString -> Maybe a -> IO () Source
Write an instance of Binary
to an InputStream
.
binaryOutputStream :: Binary a => OutputStream ByteString -> IO (OutputStream a) Source
Transform an OutputStream
accepting byte strings to an OutputStream
accepting values of type a.
Decode Exceptions
data DecodeException Source
An Exception raised when decoding fails.