Class AbstractDataFile

java.lang.Object
org.episteme.core.io.AbstractDataFile
All Implemented Interfaces:
AutoCloseable, DataFile
Direct Known Subclasses:
FITSFile

public abstract class AbstractDataFile extends Object implements DataFile
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • AbstractDataFile

      protected AbstractDataFile(Path path)
  • Method Details

    • getPath

      public Path getPath()
      Description copied from interface: DataFile
      Returns the path to this file.
      Specified by:
      getPath in interface DataFile
      Returns:
      the file path, or null if this is an in-memory or stream-based file.
    • open

      public void open(OpenOption... options) throws IOException
      Description copied from interface: DataFile
      Opens this file with the specified options.
      Specified by:
      open in interface DataFile
      Parameters:
      options - the options specifying how the file is opened
      Throws:
      IOException - if an I/O error occurs
    • isChannelOpen

      protected boolean isChannelOpen()
    • getChannel

      public SeekableByteChannel getChannel()
      Description copied from interface: DataFile
      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.

      Specified by:
      getChannel in interface DataFile
      Returns:
      the byte channel, or null if not open.
    • close

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