Interface DataFile

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractDataFile, FITSFile

public interface DataFile extends AutoCloseable
Represents a scientific data file (e.g., FITS, HDF5, NetCDF).

This interface provides a unified way to access metadata and data blocks within a structured scientific file. Implementations leverage Java NIO.2 for efficient I/O operations.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this file and releases any system resources associated with it.
    Returns the underlying byte channel for this file.
    Returns a description of the file format version or standard (e.g.
    Returns the path to this file.
    void
    open(OpenOption... options)
    Opens this file with the specified options.
  • Method Details

    • getPath

      Path getPath()
      Returns the path to this file.
      Returns:
      the file path, or null if this is an in-memory or stream-based file.
    • open

      void open(OpenOption... options) throws IOException
      Opens this file with the specified options.
      Parameters:
      options - the options specifying how the file is opened
      Throws:
      IOException - if an I/O error occurs
    • getChannel

      SeekableByteChannel getChannel()
      Returns the underlying byte channel for this file.

      This allows direct low-level access if needed, though usually standard read/write methods should be preferred.

      Returns:
      the byte channel, or null if not open.
    • close

      void close() throws IOException
      Closes this file and releases any system resources associated with it.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if an I/O error occurs
    • getFormatDescription

      String getFormatDescription()
      Returns a description of the file format version or standard (e.g. "FITS 4.0").
      Returns:
      the format description.