Interface IFileReference
- Namespace
- FellowOakDicom.IO
- Assembly
- fo-dicom.core.dll
Interface representing reference to a single file.
public interface IFileReference
- Extension Methods
Properties
Directory
Gets the directory reference of the file.
IDirectoryReference Directory { get; }
Property Value
Exists
Gets whether the file exist or not.
bool Exists { get; }
Property Value
IsTempFile
Gets and sets whether the file is temporary or not.
bool IsTempFile { get; set; }
Property Value
Name
Gets the file name.
string Name { get; }
Property Value
Methods
Create()
Creates a new file for reading and writing. Overwrites existing file.
Stream Create()
Returns
- Stream
Stream to the created file.
Delete()
Delete the file.
void Delete()
GetByteRange(long, int)
Gets a sub-range of the bytes in the file.
byte[] GetByteRange(long offset, int count)
Parameters
Returns
- byte[]
The specified sub-range of bytes in the file.
GetByteRange(long, int, byte[])
Gets a sub-range of the bytes in the file.
void GetByteRange(long offset, int count, byte[] output)
Parameters
offset
longOffset from the start position of the file.
count
intNumber of bytes to select.
output
byte[]The output array where the contents will be written
Move(string, bool)
Moves file and updates internal reference.
Calling this method will also set the IsTempFile property to False
.
void Move(string dstFileName, bool overwrite = false)
Parameters
dstFileName
stringFull name of the moved file.
overwrite
boolTrue if already existing file should be overwritten, false otherwise.
Open()
Open an existing file stream for reading and writing.
Stream Open()
Returns
OpenRead()
Open a file stream for reading.
Stream OpenRead()
Returns
- Stream
Stream to the opened file.
OpenWrite()
Open a file stream for writing, creates the file if not existing.
Stream OpenWrite()
Returns
- Stream
Stream to the opened file.