Class InMemoryFileIO

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Serializable, java.lang.AutoCloseable, FileIO

    public class InMemoryFileIO
    extends java.lang.Object
    implements FileIO
    See Also:
    Serialized Form
    • Constructor Detail

      • InMemoryFileIO

        public InMemoryFileIO()
    • Method Detail

      • addFile

        public void addFile​(java.lang.String location,
                            byte[] contents)
      • fileExists

        public boolean fileExists​(java.lang.String location)
      • newInputFile

        public InputFile newInputFile​(java.lang.String location)
        Description copied from interface: FileIO
        Get a InputFile instance to read bytes from the file at the given path.
        Specified by:
        newInputFile in interface FileIO
      • newOutputFile

        public OutputFile newOutputFile​(java.lang.String location)
        Description copied from interface: FileIO
        Get a OutputFile instance to write bytes to the file at the given path.
        Specified by:
        newOutputFile in interface FileIO
      • deleteFile

        public void deleteFile​(java.lang.String location)
        Description copied from interface: FileIO
        Delete the file at the given path.
        Specified by:
        deleteFile in interface FileIO
      • isClosed

        public boolean isClosed()
      • close

        public void close()
        Description copied from interface: FileIO
        Close File IO to release underlying resources.

        Calling this method is only required when this FileIO instance is no longer expected to be used, and the resources it holds need to be explicitly released to avoid resource leaks.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface FileIO