Class BlockingWriterSenderImpl

  • All Implemented Interfaces:
    io.undertow.io.Sender

    public class BlockingWriterSenderImpl
    extends java.lang.Object
    implements io.undertow.io.Sender
    A sender that uses a print writer. In general this should never be used. It exists for the edge case where a filter has called getWriter() and then the default servlet is being used to serve a text file.
    Author:
    Stuart Douglas
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BUFFER_SIZE
      TODO: we should be used pooled buffers
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockingWriterSenderImpl​(io.undertow.server.HttpServerExchange exchange, java.io.PrintWriter writer, java.lang.String charset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void close​(io.undertow.io.IoCallback callback)  
      void send​(java.lang.String data)  
      void send​(java.lang.String data, io.undertow.io.IoCallback callback)  
      void send​(java.lang.String data, java.nio.charset.Charset charset)  
      void send​(java.lang.String data, java.nio.charset.Charset charset, io.undertow.io.IoCallback callback)  
      void send​(java.nio.ByteBuffer buffer)  
      void send​(java.nio.ByteBuffer[] buffer)  
      void send​(java.nio.ByteBuffer[] buffer, io.undertow.io.IoCallback callback)  
      void send​(java.nio.ByteBuffer buffer, io.undertow.io.IoCallback callback)  
      void transferFrom​(java.nio.channels.FileChannel source, io.undertow.io.IoCallback callback)  
      • Methods inherited from class java.lang.Object

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

      • BUFFER_SIZE

        public static final int BUFFER_SIZE
        TODO: we should be used pooled buffers
        See Also:
        Constant Field Values
    • Constructor Detail

      • BlockingWriterSenderImpl

        public BlockingWriterSenderImpl​(io.undertow.server.HttpServerExchange exchange,
                                        java.io.PrintWriter writer,
                                        java.lang.String charset)
    • Method Detail

      • send

        public void send​(java.nio.ByteBuffer buffer,
                         io.undertow.io.IoCallback callback)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.nio.ByteBuffer[] buffer,
                         io.undertow.io.IoCallback callback)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.lang.String data,
                         io.undertow.io.IoCallback callback)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.nio.ByteBuffer buffer)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.nio.ByteBuffer[] buffer)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.lang.String data,
                         java.nio.charset.Charset charset,
                         io.undertow.io.IoCallback callback)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.lang.String data)
        Specified by:
        send in interface io.undertow.io.Sender
      • send

        public void send​(java.lang.String data,
                         java.nio.charset.Charset charset)
        Specified by:
        send in interface io.undertow.io.Sender
      • transferFrom

        public void transferFrom​(java.nio.channels.FileChannel source,
                                 io.undertow.io.IoCallback callback)
        Specified by:
        transferFrom in interface io.undertow.io.Sender
      • close

        public void close​(io.undertow.io.IoCallback callback)
        Specified by:
        close in interface io.undertow.io.Sender
      • close

        public void close()
        Specified by:
        close in interface io.undertow.io.Sender