Class MessageOutput


  • public class MessageOutput
    extends java.lang.Object
    An output for a series of messages which each have sizes specified before the start of the message. Even when the decoder does not recognize some of the messages, it can skip over the message since it knows its size in advance.
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageOutput​(java.io.OutputStream outputStream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void commitMessage()
      Commit previously started message to the underlying output stream.
      void commitMessage​(int flags)
      Commit previously started message to the underlying output stream.
      void finish()
      Write an end marker to the stream so that decoder knows to return null at this position.
      java.io.DataOutput startMessage()  
      • Methods inherited from class java.lang.Object

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

      • MessageOutput

        public MessageOutput​(java.io.OutputStream outputStream)
        Parameters:
        outputStream - Output stream to write the messages to
    • Method Detail

      • startMessage

        public java.io.DataOutput startMessage()
        Returns:
        Data output for a new message
      • commitMessage

        public void commitMessage()
                           throws java.io.IOException
        Commit previously started message to the underlying output stream.
        Throws:
        java.io.IOException - On IO error
      • commitMessage

        public void commitMessage​(int flags)
                           throws java.io.IOException
        Commit previously started message to the underlying output stream.
        Parameters:
        flags - Flags to use when committing the message (0-3).
        Throws:
        java.io.IOException - On IO error
      • finish

        public void finish()
                    throws java.io.IOException
        Write an end marker to the stream so that decoder knows to return null at this position.
        Throws:
        java.io.IOException - On IO error