Clone len bytes from this cursor into an IOBuf.

Synopses

Declared in <folly/io/Cursor.h>

Clone len bytes from this cursor into an IOBuf.

void
clone(
    folly::IOBuf& buf,
    size_t len,
    CloneOwnership ownership = CloneOwnership::Shared);

Clone len bytes from this cursor into an IOBuf.

void
clone(
    std::unique_ptr<folly::IOBuf>& buf,
    size_t len,
    CloneOwnership ownership = CloneOwnership::Shared);

Exceptions

Name

Thrown on

std::out_of_range

if there aren't enough bytes in this cursor.

Parameters

Name

Description

buf [out]

The IOBuf into which to place the cloned data.

len

The number of bytes to clone.

ownership

Whether the clone may point at data that IOBuf does not own.

See Also

CloneOwnership.

Created with MrDocs