HaskellNet-0.3.1: Client support for POP3, SMTP, and IMAP

Safe HaskellSafe-Inferred

Network.HaskellNet.BSStream

Description

This module provides a byte string "stream" interface. This interface provides some common operations on a value which supports reading and writing byte strings.

Synopsis

Documentation

data BSStream Source

A byte string stream.

Constructors

BSStream 

Fields

bsGetLine :: IO ByteString

Read a line from the stream. Should return the line which was read, including the newline.

bsGet :: Int -> IO ByteString

Read the specified number of bytes from the stream. Should block until the requested bytes can be read.

bsPut :: ByteString -> IO ()

Write the specified byte string to the stream. Should flush the stream after writing.

bsFlush :: IO ()

Flush the stream.

bsClose :: IO ()

Close the stream.

bsIsOpen :: IO Bool

Is the stream open?

handleToStream :: Handle -> BSStreamSource

Build a byte string stream which operates on a Handle.