Write a byte range from a blob to a stream.

Synopsis

Declared in <bdlbb_blobutil.h>

template<class STREAM>
static
int
write(
    STREAM& stream,
    Blob const& source,
    int sourcePosition,
    int numBytes);

Description

Write to the specified stream the specified numBytes starting at the specified sourcePosition in the specified source blob. Return 0 on success or a non‐zero value otherwise. Note that this function will fail (immediately) if the length of source is less than numBytes; or if there is any error writing to stream.

Return Value

0 on success, and a non‐zero value otherwise

Parameters

Name

Description

stream

output stream

source

source blob

sourcePosition

starting byte offset in source

numBytes

number of bytes to write

Created with MrDocs