YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SizedWriter.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
8
9#include <yarp/os/Bytes.h>
12
13
15
17{
18 for (size_t i = 0; i < length(); i++) {
19 Bytes b((char*)data(i), length(i));
20 os.write(b);
21 }
22}
23
25{
26 for (size_t i = 0; i < length(); i++) {
27 connection.appendBlock((char*)data(i), length(i));
28 }
29 return true;
30}
31
A mini-server for performing network communication in the background.
A simple abstraction for a block of bytes.
Definition Bytes.h:24
An interface for writing to a network connection.
Simple specification of the minimum functions needed from output streams.
virtual void write(char ch)
Write a single byte to the stream.
virtual void write(OutputStream &os)
virtual const char * data(size_t index) const =0
virtual size_t length() const =0
virtual void clear()