Package io.protostuff

Class JsonXIOUtil


  • public final class JsonXIOUtil
    extends java.lang.Object
    Json serialization via JsonXOutput.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] EMPTY_ARRAY  
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonXIOUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> byte[] toByteArray​(T message, Schema<T> schema, boolean numeric, LinkedBuffer buffer)  
      static <T> void writeListTo​(LinkedBuffer buffer, java.util.List<T> messages, Schema<T> schema, boolean numeric)
      Serializes the messages into the LinkedBuffer using the given schema.
      static <T> void writeListTo​(java.io.OutputStream out, java.util.List<T> messages, Schema<T> schema, boolean numeric, LinkedBuffer buffer)
      Serializes the messages into the stream using the given schema with the supplied buffer.
      static <T> void writeTo​(LinkedBuffer buffer, T message, Schema<T> schema, boolean numeric)
      Serializes the message into a LinkedBuffer via JsonXOutput using the given schema with the supplied buffer.
      static <T extends Message<T>>
      void
      writeTo​(java.io.OutputStream out, T message, boolean numeric, LinkedBuffer buffer)
      Serializes the message into an OutputStream via JsonXOutput with the supplied buffer.
      static <T> void writeTo​(java.io.OutputStream out, T message, Schema<T> schema, boolean numeric, LinkedBuffer buffer)
      Serializes the message into an OutputStream via JsonXOutput using the given schema.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY_ARRAY

        private static final byte[] EMPTY_ARRAY
    • Constructor Detail

      • JsonXIOUtil

        public JsonXIOUtil()
    • Method Detail

      • toByteArray

        public static <T> byte[] toByteArray​(T message,
                                             Schema<T> schema,
                                             boolean numeric,
                                             LinkedBuffer buffer)
      • writeTo

        public static <T> void writeTo​(LinkedBuffer buffer,
                                       T message,
                                       Schema<T> schema,
                                       boolean numeric)
        Serializes the message into a LinkedBuffer via JsonXOutput using the given schema with the supplied buffer.
      • writeTo

        public static <T extends Message<T>> void writeTo​(java.io.OutputStream out,
                                                          T message,
                                                          boolean numeric,
                                                          LinkedBuffer buffer)
                                                   throws java.io.IOException
        Serializes the message into an OutputStream via JsonXOutput with the supplied buffer.
        Throws:
        java.io.IOException
      • writeTo

        public static <T> void writeTo​(java.io.OutputStream out,
                                       T message,
                                       Schema<T> schema,
                                       boolean numeric,
                                       LinkedBuffer buffer)
                                throws java.io.IOException
        Serializes the message into an OutputStream via JsonXOutput using the given schema.
        Throws:
        java.io.IOException
      • writeListTo

        public static <T> void writeListTo​(LinkedBuffer buffer,
                                           java.util.List<T> messages,
                                           Schema<T> schema,
                                           boolean numeric)
        Serializes the messages into the LinkedBuffer using the given schema.
      • writeListTo

        public static <T> void writeListTo​(java.io.OutputStream out,
                                           java.util.List<T> messages,
                                           Schema<T> schema,
                                           boolean numeric,
                                           LinkedBuffer buffer)
                                    throws java.io.IOException
        Serializes the messages into the stream using the given schema with the supplied buffer.
        Throws:
        java.io.IOException