Extracts complete packets of the specified length, preserving remainder data.
Extracts complete packets of the specified length, preserving remainder data. If there is no complete packet, then we return an empty list. If there are multiple packets available, all packets are extracted, Any remaining data is returned to the caller for later submission
A list of the packets extracted from the raw data in order of receipt
A list of ByteStrings containing extracted packets as well as any remaining buffer data not consumed
Taken from https://stackoverflow.com/questions/30665811/scala-tcp-packet-frame-using-akka