Class ByteBufferOutput

java.lang.Object
io.jooby.rocker.ByteBufferOutput
All Implemented Interfaces:
com.fizzed.rocker.RockerOutput<ByteBufferOutput>

public class ByteBufferOutput extends Object implements com.fizzed.rocker.RockerOutput<ByteBufferOutput>
Rocker output that uses a byte array to render the output.
Author:
edgar
  • Field Details

    • BUFFER_SIZE

      public static final int BUFFER_SIZE
      Default buffer size: 4k.
      See Also:
  • Method Details

    • getContentType

      public com.fizzed.rocker.ContentType getContentType()
      Specified by:
      getContentType in interface com.fizzed.rocker.RockerOutput<ByteBufferOutput>
    • getCharset

      public Charset getCharset()
      Specified by:
      getCharset in interface com.fizzed.rocker.RockerOutput<ByteBufferOutput>
    • w

      public ByteBufferOutput w(String string)
      Specified by:
      w in interface com.fizzed.rocker.RockerOutput<ByteBufferOutput>
    • w

      public ByteBufferOutput w(byte[] bytes)
      Specified by:
      w in interface com.fizzed.rocker.RockerOutput<ByteBufferOutput>
    • getByteLength

      public int getByteLength()
      Specified by:
      getByteLength in interface com.fizzed.rocker.RockerOutput<ByteBufferOutput>
    • toBuffer

      public ByteBuffer toBuffer()
      Get a view of the byte buffer.
      Returns:
      Byte buffer.
    • toByteArray

      public byte[] toByteArray()
      Copy internal byte array into a new array.
      Returns:
      Byte array.