Encodes the length of the String as a prefix and copies it into a ByteArray at a given offset.
the ByteArray containing the encoded length
the ByteArray to copy the encoded length into.
the size of the String
the ByteOrder to use.
the offset at which to copy the encoded length.