decode

fun decode(bytes: ByteArray): Handshake?

Parse a 68-byte handshake. Returns null if bytes is shorter than LENGTH, if the length prefix is not 19, or if the protocol string does not match, which means the peer is not speaking BitTorrent v1. Bytes beyond LENGTH are ignored (they belong to subsequent messages on the stream).