writePacket

fun OutputStream.writePacket(
    builder: BytePacketBuilder.() -> Unit
): Unit

Write the whole packet to the stream once it is built via builder lambda

fun OutputStream.writePacket(packet: ByteReadPacket): Unit

Write the whole packet to the stream