Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

pdf_long PoDoFo::PdfMemoryInputStream::Read ( char *  pBuffer,
pdf_long  lLen 
) [virtual]

Read data from the input stream

pBufferthe data will be stored into this buffer
lLenthe size of the buffer and number of bytes that will be read
the number of bytes read, -1 if an error ocurred and zero if no more bytes are available for reading.

Implements PoDoFo::PdfInputStream.

Definition at line 105 of file PdfInputStream.cpp.

References PoDoFo::ePdfError_InvalidHandle.

    if( !pBuffer ) 
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );

    pdf_long lRead = m_pCur - m_pBuffer;

    // return zero if EOF is reached
    if( lRead == m_lBufferLen ) 
        return 0;

    lLen = ( lRead + lLen <= m_lBufferLen ? lLen : m_lBufferLen - lRead );
    memcpy( pBuffer, m_pCur, lLen );
    m_pCur += lLen;
    return lLen;

Generated by  Doxygen 1.6.0   Back to index