Class StreamOutput

  • All Implemented Interfaces:
    Output

    public class StreamOutput
    extends java.lang.Object
    implements Output
    Author:
    oleksiys
    • Constructor Detail

      • StreamOutput

        public StreamOutput​(StreamWriter streamWriter)
    • Method Detail

      • write

        public void write​(byte data)
                   throws java.io.IOException
        Specified by:
        write in interface Output
        Throws:
        java.io.IOException
      • write

        public void write​(Buffer buffer)
                   throws java.io.IOException
        Specified by:
        write in interface Output
        Throws:
        java.io.IOException
      • isBuffered

        public boolean isBuffered()
        Specified by:
        isBuffered in interface Output
      • ensureBufferCapacity

        public void ensureBufferCapacity​(int size)
                                  throws java.io.IOException
        Specified by:
        ensureBufferCapacity in interface Output
        Throws:
        java.io.IOException
      • flush

        public GrizzlyFuture<java.lang.Integer> flush​(CompletionHandler<java.lang.Integer> completionHandler)
                                               throws java.io.IOException
        Description copied from interface: Output
        Make sure that all data that has been written is flushed from the stream to its destination.
        Specified by:
        flush in interface Output
        Throws:
        java.io.IOException
      • close

        public GrizzlyFuture<java.lang.Integer> close​(CompletionHandler<java.lang.Integer> completionHandler)
                                               throws java.io.IOException
        Description copied from interface: Output
        Close the StreamWriter and make sure all data was flushed.
        Specified by:
        close in interface Output
        Throws:
        java.io.IOException