BBufferIO Class Reference

#include <support/BufferIO.h>

Inheritance diagram for BBufferIO:

BnByteInput BnByteOutput BnByteSeekable BnInterface< IByteInput > BnInterface< IByteOutput > BnInterface< IByteSeekable > IByteInput BBinder IByteOutput BBinder IByteSeekable BBinder IInterface IBinder IInterface IBinder IInterface IBinder SAtom SAtom SAtom SAtom SAtom SAtom List of all members.

Detailed Description

Buffering on a generic byte stream.

Instantiante this class, pointing to an existing byte stream (IByteInput, IByteOutput, and IByteSeekable interfaces). This gives you a new byte stream that performs buffering of reads/writes before calling to the real stream.


Public Member Functions

 BBufferIO (const sptr< IByteInput > &inStream, const sptr< IByteOutput > &outStream, const sptr< IByteSeekable > &seeker, size_t buf_size=DEFAULT_BUF_SIZE)
status_t Flush ()
virtual off_t Position () const
 Return the current location in the stream, or a negative error code.
virtual ssize_t ReadV (const struct iovec *vector, ssize_t count, uint32_t flags=0)
virtual off_t Seek (off_t position, uint32_t seek_mode)
 Move to a new location in the stream.
virtual status_t Sync ()
 Make sure all data in the stream is written to its physical device.
virtual ssize_t WriteV (const struct iovec *vector, ssize_t count, uint32_t flags=0)
virtual ~BBufferIO ()

Protected Member Functions

 BBufferIO (size_t buf_size=DEFAULT_BUF_SIZE)


Constructor & Destructor Documentation

BBufferIO const sptr< IByteInput > &  inStream,
const sptr< IByteOutput > &  outStream,
const sptr< IByteSeekable > &  seeker,
size_t  buf_size = DEFAULT_BUF_SIZE
 

~BBufferIO  )  [virtual]
 

BBufferIO size_t  buf_size = DEFAULT_BUF_SIZE  )  [protected]
 


Member Function Documentation

status_t Flush  ) 
 

off_t Position  )  const [virtual]
 

Return the current location in the stream, or a negative error code.

Implements IByteSeekable.

virtual ssize_t ReadV const struct iovec *  vector,
ssize_t  count,
uint32_t  flags = 0
[virtual]
 

off_t Seek off_t  position,
uint32_t  seek_mode
[virtual]
 

Move to a new location in the stream.

The seek_mode can be either SEEK_SET, SEEK_END, or SEEK_CUR. Returns the new location, or a negative error code.

Implements IByteSeekable.

status_t Sync  )  [virtual]
 

Make sure all data in the stream is written to its physical device.

Returns B_OK if the data is safely stored away, else an error code.

Implements IByteOutput.

virtual ssize_t WriteV const struct iovec *  vector,
ssize_t  count,
uint32_t  flags = 0
[virtual]
 


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