public class InMemoryFileIO extends java.lang.Object implements FileIO
Constructor and Description |
---|
InMemoryFileIO() |
Modifier and Type | Method and Description |
---|---|
void |
addFile(java.lang.String location,
byte[] contents) |
void |
close()
Close File IO to release underlying resources.
|
void |
deleteFile(java.lang.String location)
Delete the file at the given path.
|
boolean |
fileExists(java.lang.String location) |
boolean |
isClosed() |
InputFile |
newInputFile(java.lang.String location)
Get a
InputFile instance to read bytes from the file at the given path. |
OutputFile |
newOutputFile(java.lang.String location)
Get a
OutputFile instance to write bytes to the file at the given path. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteFile, deleteFile, initialize, newInputFile, newInputFile, newInputFile, newInputFile, properties
public void addFile(java.lang.String location, byte[] contents)
public boolean fileExists(java.lang.String location)
public InputFile newInputFile(java.lang.String location)
FileIO
InputFile
instance to read bytes from the file at the given path.newInputFile
in interface FileIO
public OutputFile newOutputFile(java.lang.String location)
FileIO
OutputFile
instance to write bytes to the file at the given path.newOutputFile
in interface FileIO
public void deleteFile(java.lang.String location)
FileIO
deleteFile
in interface FileIO
public boolean isClosed()
public void close()
FileIO
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.