@Override
 public void writeTo(
     final Message m,
     final Class<?> type,
     final Type genericType,
     final Annotation[] annotations,
     final MediaType mediaType,
     final MultivaluedMap<String, Object> httpHeaders,
     final OutputStream entityStream)
     throws IOException {
   entityStream.write(m.toByteArray());
 }
 public byte[] serializeToByteArray(Message msg) {
   return msg.toByteArray();
 }
 public static Text toText(Message message) {
   return new Text(message.toByteArray());
 }