4 * Bounded variable page size
\r
10 if leftoverPacket != NULL then
\r
11 -- There is some packet left
\r
12 while (amountLeftover) > 0 do
\r
13 packet_out(inPacket, startFrom = packetUpto, length = MIN(spaceLeft, amountLeftOver))
\r
18 if inPacket.size <= spaceLeft then
\r
19 --add inPacket to page
\r
20 packet_out( inPacket, startFrom = 0, length = inPacket.size)
\r
22 -- Packet must span over page
\r
23 packet_out( inPacket, startFrom = packetUpto, length = spaceLeft)
\r
26 copy spaceLeft bytes of packet into halfPacket
\r
33 write min(packet.size, bufferLeft)