public static byte[] encode(String s) {
        return s == null ? new byte[0] : s.getBytes(RpcConstants.DEFAULT_CHARSET);
    }
@Test
    public void encode() {
        Assert.assertTrue(StringSerializer.encode("11").length == 2);
        Assert.assertTrue(StringSerializer.encode("").length == 0);
        Assert.assertTrue(StringSerializer.encode(null).length == 0);
    }