#include <oskit/io/bufio.h>OSKIT_COMDECL copy(oskit_bufio_t *io, oskit_off_t offset, oskit_size_t amount, [out] oskit_bufio_t **out_io);
This method attempts to create a logical copy of a portion of this buffer object (possibly the whole buffer), returning a new oskit_bufio object representing the copy. As with the map and wire methods, this method should only be implemented by an object if it can be done more efficiently than a simple ``brute-force'' copy using read. For example, in virtual memory environments, the object may be able to use copy-on-write optimizations. Similarly, if the buffer's contents are stored in special memory not efficiently accessible to the processor, such as memory on a video or coprocessor board, this method could use on-board hardware to perform a much faster copy.
- io
- The object whose contents are to be copied.
- offset
- The offset into the buffer of the region to be copied.
- size
- The size of the region to be copied.
- out_io
- On success, this parameter holds the bufio object representing the newly created copy of the buffer's contents.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.