Class ContentChannelOutputStream

    • Constructor Summary

      Constructors 
      Constructor Description
      ContentChannelOutputStream​(com.yahoo.jdisc.handler.ContentChannel endpoint)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Flush the internal buffers, does not touch the ContentChannel.
      void flush()
      Flush the internal buffers, does not touch the ContentChannel.
      void nonCopyingWrite​(byte[] b)
      Buffered write the contents of the array to this stream, transferring ownership of that array to this stream.
      void nonCopyingWrite​(byte[] b, int off, int len)
      Buffered write of the contents of the array to this stream, transferring ownership of that array to this stream.
      void send​(ByteBuffer src)
      Write a ByteBuffer to the wrapped ContentChannel.
      protected void send​(ByteBuffer src, com.yahoo.jdisc.handler.CompletionHandler completionHandler)  
      void write​(byte[] b)
      Buffered write the contents of the array to this stream, copying the contents of the given array to this stream.
      void write​(byte[] b, int off, int len)
      Buffered write of the contents of the array to this stream, copying the contents of the given array to this stream.
      void write​(int b)
      Buffered write of a single byte.
      long written()
      Returns the number of bytes written to this stream
    • Constructor Detail

      • ContentChannelOutputStream

        public ContentChannelOutputStream​(com.yahoo.jdisc.handler.ContentChannel endpoint)
    • Method Detail

      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws IOException
        Buffered write of the contents of the array to this stream, copying the contents of the given array to this stream. It is in other words safe to recycle the array b.
        Overrides:
        write in class OutputStream
        Throws:
        IOException
      • write

        public void write​(byte[] b)
                   throws IOException
        Buffered write the contents of the array to this stream, copying the contents of the given array to this stream. It is in other words safe to recycle the array b.
        Overrides:
        write in class OutputStream
        Throws:
        IOException
      • nonCopyingWrite

        public void nonCopyingWrite​(byte[] b,
                                    int off,
                                    int len)
                             throws IOException
        Buffered write of the contents of the array to this stream, transferring ownership of that array to this stream. It is in other words not safe to recycle the array b.
        Throws:
        IOException
      • nonCopyingWrite

        public void nonCopyingWrite​(byte[] b)
                             throws IOException
        Buffered write the contents of the array to this stream, transferring ownership of that array to this stream. It is in other words not safe to recycle the array b.
        Throws:
        IOException
      • send

        public void send​(ByteBuffer src)
                  throws IOException
        Write a ByteBuffer to the wrapped ContentChannel. Do invoke flush() before send(ByteBuffer) to avoid garbled output if the stream API has been accessed before using the ByteBuffer based API. As with ContentChannel, this transfers ownership of the ByteBuffer to this stream.
        Specified by:
        send in interface com.yahoo.io.WritableByteTransmitter
        Throws:
        IOException
      • written

        public long written()
        Returns the number of bytes written to this stream