27 size_t singlePacketSize,
32 if (input.size() > singlePacketSize)
36 const size_t dataSize = singlePacketSize - 1;
37 const size_t packetCount =
static_cast<size_t>(std::ceil(
38 static_cast<double>(input.size()) / dataSize));
40 for (uint8_t index = 0; index < packetCount; ++index)
44 if (index == packetCount - 1)
48 input.begin() + index * dataSize,
49 std::min(dataSize, input.size() - index * dataSize),
51 func(input.size() - index * dataSize);
56 input.begin() + index * dataSize,
59 func(singlePacketSize);
86 size_t singlePacketSize
90 if (singlePacketSize == 0)
95 if (output.size() <= singlePacketSize)
101 std::min(input.size(), output.size()),
109 const auto index = input.at(0);
111 const size_t dataSize = singlePacketSize - 1;
112 const size_t packetCount =
static_cast<size_t>(std::ceil(
113 static_cast<double>(output.size()) / dataSize));
115 if (index >= packetCount)
120 if (index == packetCount - 1)
125 output.size() - index * dataSize,
126 output.begin() + index * dataSize);
134 output.begin() + index * dataSize);