Class Chunk

java.lang.Object
com.mulesoftforge.mule.extension.chunking.api.Chunk

public class Chunk extends Object
Represents a single chunk of binary data from a larger stream. Immutable - all fields set at construction.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Chunk(byte[] data, int index, long offset, int length, boolean isFirst, boolean isLast)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Raw binary data for this chunk.
    int
    0-based chunk index.
    int
    Number of bytes in this chunk.
    long
    Byte offset in the original source stream.
    boolean
    True if this is the first chunk (index == 0).
    boolean
    True if this is the last chunk in the stream.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Chunk

      public Chunk(byte[] data, int index, long offset, int length, boolean isFirst, boolean isLast)
  • Method Details

    • getData

      public byte[] getData()
      Raw binary data for this chunk.
    • getIndex

      public int getIndex()
      0-based chunk index.
    • getOffset

      public long getOffset()
      Byte offset in the original source stream.
    • getLength

      public int getLength()
      Number of bytes in this chunk.
    • isFirst

      public boolean isFirst()
      True if this is the first chunk (index == 0).
    • isLast

      public boolean isLast()
      True if this is the last chunk in the stream.
    • toString

      public String toString()
      Overrides:
      toString in class Object