pdf-toolbox-core-0.0.4.1: A collection of tools for processing PDF files.

Safe HaskellNone
LanguageHaskell98

Pdf.Toolbox.Core.IO

Description

Basic IO operations for PDF

Synopsis

Documentation

type IS = InputStream ByteString Source

Sequential input stream

data RIS Source

Random access Input Stream

fromHandle :: Handle -> IO RIS Source

Create RIS from Handle with default chunk size

fromHandle' :: Handle -> Int -> IO RIS Source

Create RIS from Handle with the specified chunk size

class Monad m => MonadIO m where

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Methods

liftIO :: IO a -> m a

Lift a computation from the IO monad.

Instances

liftIO :: MonadIO m => forall a. IO a -> m a

Lift a computation from the IO monad.

size :: MonadIO m => RIS -> PdfE m Int64 Source

Total number of bytes in RIS

seek :: MonadIO m => RIS -> Int64 -> PdfE m () Source

Change input position in RIS

tell :: MonadIO m => RIS -> PdfE m Int64 Source

Current input position

parse :: MonadIO m => Parser r -> IS -> PdfE m r Source

Parse from IS

inputStream :: MonadIO m => RIS -> PdfE m IS Source

Convert random access stream to sequential

dropExactly :: MonadIO m => Int -> IS -> PdfE m () Source

Same as readExactly, but ignores the result