Interface Data

    • Method Summary

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

      • 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,
                        java.nio.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