public static byte[] encode(Slime slime) {
        return new BinaryEncoder().encode(slime).toArray();
    }
Take a Slime object and serialize it into binary format.
@param slime the object which is to be serialized.
@return a new byte array with just the encoded slime.
vespajlib/src/main/java/com/yahoo/slime/BinaryFormat.java