MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / doWrite

Method doWrite

source/core/StarBuffer.cpp:183–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183size_t Buffer::doWrite(size_t pos, char const* data, size_t len) {
184 if (len == 0)
185 return 0;
186
187 if (!isWritable())
188 throw EofException("Error, write called on non-writable Buffer");
189
190 if (pos + len > m_bytes.size())
191 m_bytes.resize(pos + len);
192
193 memcpy(m_bytes.ptr() + pos, data, len);
194 return len;
195}
196
197ExternalBuffer::ExternalBuffer()
198 : m_pos(0), m_bytes(nullptr), m_size(0) {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected