Interface Data

All Known Implementing Classes:
FileData, MemoryData

interface Data
  • Method Summary

    Modifier and Type
    Method
    Description
    createNext(DataHead dataHead, ByteBuffer buf)
    Factory method to create a Data.
    byte[]
    TODO: should the return type be ByteBuffer ?? Return part's partial data.
    int
    size of the chunk given by the parser
    long
    Write this partial data to a file
  • Method Details

    • size

      int size()
      size of the chunk given by the parser
      Returns:
      size of the chunk
    • read

      byte[] read()
      TODO: should the return type be ByteBuffer ?? Return part's partial data. The data is read only.
      Returns:
      a byte array which contains {#size()} bytes. The returned array may be larger than {#size()} bytes and contains data from offset 0.
    • writeTo

      long writeTo(DataFile file)
      Write this partial data to a file
      Parameters:
      file - to which the data needs to be written
      Returns:
      file pointer before the write operation(at which the data is written from)
    • createNext

      Data createNext(DataHead dataHead, ByteBuffer buf)
      Factory method to create a Data. The implementation could be file based one or memory based one.
      Parameters:
      dataHead - start of the linked list of data objects
      buf - contains partial content for a part
      Returns:
      Data