Package io.protostuff

Class XmlXIOUtil


  • public final class XmlXIOUtil
    extends java.lang.Object
    IO Utils for writing xml via XmlXOutput.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static byte[] HEADER  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private XmlXIOUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> byte[] toByteArray​(T message, Schema<T> schema, LinkedBuffer buffer)
      Serializes the message into a byte array using the given schema.
      static <T> int writeTo​(LinkedBuffer buffer, T message, Schema<T> schema)
      Writes the message into the LinkedBuffer using the given schema.
      static <T> int writeTo​(java.io.OutputStream out, T message, Schema<T> schema, LinkedBuffer buffer)
      Serializes the message into an OutputStream using the given schema.
      • Methods inherited from class java.lang.Object

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

      • HEADER

        static final byte[] HEADER
    • Constructor Detail

      • XmlXIOUtil

        private XmlXIOUtil()
    • Method Detail

      • toByteArray

        public static <T> byte[] toByteArray​(T message,
                                             Schema<T> schema,
                                             LinkedBuffer buffer)
        Serializes the message into a byte array using the given schema.
        Returns:
        the byte array containing the data.
      • writeTo

        public static <T> int writeTo​(LinkedBuffer buffer,
                                      T message,
                                      Schema<T> schema)
        Writes the message into the LinkedBuffer using the given schema.
        Returns:
        the size of the message
      • writeTo

        public static <T> int writeTo​(java.io.OutputStream out,
                                      T message,
                                      Schema<T> schema,
                                      LinkedBuffer buffer)
                               throws java.io.IOException
        Serializes the message into an OutputStream using the given schema.
        Returns:
        the size of the message
        Throws:
        java.io.IOException