Interface DataContext


  • public interface DataContext
    The context provides the means to read from or write to a random access stream or file.

    I/O performance my be tuned by setting the ceres.binio.segmentSizeLimit system property to the size (in bytes) of data segments shared by multiple subsequent compounds members.

    Since:
    Ceres 0.8
    Version:
    $Revision$ $Date$
    • Method Detail

      • getFormat

        DataFormat getFormat()
        Returns:
        the file format.
      • getHandler

        IOHandler getHandler()
        Returns:
        the associated I/O-handler used to read from or write to a random access stream or file.
      • getData

        CompoundData getData()
        Gets an instance of a compound with I/O starting at the given stream or file position. The type of the compound is the same as the format's compound type. In contrast to createData(), the method will always return the same compound instance.
        Returns:
        The instance of a data compound.
        See Also:
        createData(), getFormat()
      • createData

        CompoundData createData()
        Creates an instance of a compound with I/O starting at the beginning of the stream or file.
        Returns:
        An instance of a data compound.
        See Also:
        getFormat()
      • createData

        CompoundData createData​(long position)
        Creates an instance of a compound with the given type and with I/O starting at the given stream or file position.
        Parameters:
        position - The file position in bytes.
        Returns:
        An instance of a data compound.
        See Also:
        getFormat()
      • createData

        CompoundData createData​(CompoundType type,
                                long position)
        Creates an instance of a compound with the given type and with I/O starting at the given stream or file position.
        Parameters:
        type - The compound type.
        position - The file position in bytes.
        Returns:
        An instance of a data compound.
      • dispose

        void dispose()
        Disposes this context and releases all associated resources.