Class Chunk

java.lang.Object
com.predic8.membrane.core.http.Chunk

public class Chunk extends Object
A chunk of a HTTP message body.

Also see Chunked Transfer Encoding .

Used (independently of whether "Transfer-Encoding: chunked" is actually present) to store the message body's data.

  • Constructor Details

    • Chunk

      public Chunk(byte[] content)
  • Method Details

    • getContent

      public byte[] getContent()
    • getLength

      public int getLength()
    • write

      public void write(OutputStream out) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Supposes UTF-8 encoding. Should therefore not be used for primary functionality.
      Overrides:
      toString in class Object
    • copyChunk

      public int copyChunk(byte[] raw, int destPos)
    • copyChunkLength

      public int copyChunkLength(byte[] raw, int destPos, AbstractBody body)