SkMemoryStream Class Reference

#include <SkStream.h>

Inherits SkStream.

Inherited by SkMMAPStream.

Collaboration diagram for SkMemoryStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SkMemoryStream ()
 SkMemoryStream (size_t length)
 SkMemoryStream (const void *data, size_t length, bool copyData=false)
virtual ~SkMemoryStream ()
virtual void setMemory (const void *data, size_t length, bool copyData=false)
void skipToAlign4 ()
virtual bool rewind ()
virtual size_t read (void *buffer, size_t size)
virtual const void * getMemoryBase ()
const void * getAtPos ()
size_t seek (size_t offset)
size_t peek () const

Detailed Description

Definition at line 162 of file SkStream.h.


Constructor & Destructor Documentation

SkMemoryStream::SkMemoryStream (  ) 
SkMemoryStream::SkMemoryStream ( size_t  length  ) 

We allocate (and free) the memory. Write to it via getMemoryBase()

SkMemoryStream::SkMemoryStream ( const void *  data,
size_t  length,
bool  copyData = false 
)

if copyData is true, the stream makes a private copy of the data

virtual SkMemoryStream::~SkMemoryStream (  )  [virtual]

Member Function Documentation

const void* SkMemoryStream::getAtPos (  ) 
virtual const void* SkMemoryStream::getMemoryBase (  )  [virtual]

If the stream is backed by RAM, this method returns the starting address for the data. If not (i.e. it is backed by a file or other structure), this method returns NULL. The default implementation returns NULL.

Reimplemented from SkStream.

size_t SkMemoryStream::peek (  )  const [inline]

Definition at line 185 of file SkStream.h.

virtual size_t SkMemoryStream::read ( void *  buffer,
size_t  size 
) [virtual]

Called to read or skip size number of bytes. If buffer is NULL and size > 0, skip that many bytes, returning how many were skipped. If buffer is NULL and size == 0, return the total length of the stream. If buffer != NULL, copy the requested number of bytes into buffer, returning how many were copied.

Parameters:
buffer If buffer is NULL, ignore and just skip size bytes, otherwise copy size bytes into buffer
size The number of bytes to skip or copy
Returns:
bytes read on success

Implements SkStream.

virtual bool SkMemoryStream::rewind (  )  [virtual]

Called to rewind to the beginning of the stream. If this cannot be done, return false.

Implements SkStream.

size_t SkMemoryStream::seek ( size_t  offset  ) 
virtual void SkMemoryStream::setMemory ( const void *  data,
size_t  length,
bool  copyData = false 
) [virtual]

Resets the stream to the specified data and length, just like the constructor. if copyData is true, the stream makes a private copy of the data

Reimplemented in SkMMAPStream.

void SkMemoryStream::skipToAlign4 (  ) 

The documentation for this class was generated from the following file:

Generated on Tue Oct 20 11:03:42 2009 for Skia by  doxygen 1.6.1