Exemplo n.º 1
0
void
BufferWriter::writeSlow(const void *src, size_t len)
{
    size_t residue = len;
    const char *csrc = static_cast<const char *>(src);
    for (;;) {
        size_t maxLen = freeLen();
        if (residue <= maxLen) {
            writeFast(csrc, residue);
            break;
        }
        if (maxLen != 0) {
            writeFast(csrc, maxLen);
            csrc += maxLen;
            residue -= maxLen;
        }
        flush();
    }
}
Exemplo n.º 2
0
bool Radio::writeFast(const void *buf, uint8_t len) {
  return writeFast(buf, len, 0);
}