Class StreamPBIntoOutput


  • public class StreamPBIntoOutput
    extends Object
    Utility class with method to push an EventStream into an OutputStream
    Author:
    mshankar
    • Constructor Detail

      • StreamPBIntoOutput

        public StreamPBIntoOutput()
    • Method Detail

      • streamPBIntoOutputStream

        public static int streamPBIntoOutputStream​(EventStream st,
                                                   OutputStream os,
                                                   Timestamp start,
                                                   Timestamp end)
                                            throws IOException
        Push the events in st into the output stream os. This is highly simplistic and does not accommodate year transitions, pv transitions and such.
        Parameters:
        st - EventStream
        os - OutputStream
        start - The start time; could be null in which case we begin at the very beginning
        end - The end time; could be null in which case we end at the very end
        Returns:
        totalEvents  
        Throws:
        IOException -  
      • writeHeaderOnly

        public static void writeHeaderOnly​(OutputStream os,
                                           RemotableEventStreamDesc desc)
                                    throws IOException
        Write a header only - this is sometimes used to communicate the latest copy of the meta-fields (EGU etc) from the engine to the client even if we have no data in the engine.
        Parameters:
        os - OutputStream
        desc - RemotableEventStreamDesc
        Throws:
        IOException -