Interface IFileReference
Interface representing reference to a single file.
Namespace: Dicom.IO
Assembly: cs.temp.dll.dll
Syntax
public interface IFileReference
Properties
Directory
Gets the directory reference of the file.
Declaration
IDirectoryReference Directory { get; }
Property Value
Type | Description |
---|---|
IDirectoryReference |
Exists
Gets whether the file exist or not.
Declaration
bool Exists { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsTempFile
Gets and sets whether the file is temporary or not.
Declaration
bool IsTempFile { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Name
Gets the file name.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
Methods
Create()
Creates a new file for reading and writing. Overwrites existing file.
Declaration
Stream Create()
Returns
Type | Description |
---|---|
Stream | Stream to the created file. |
Delete()
Delete the file.
Declaration
void Delete()
GetByteRange(Int64, Int32)
Gets a sub-range of the bytes in the file.
Declaration
byte[] GetByteRange(long offset, int count)
Parameters
Type | Name | Description |
---|---|---|
Int64 | offset | Offset from the start position of the file. |
Int32 | count | Number of bytes to select. |
Returns
Type | Description |
---|---|
Byte[] | The specified sub-range of bytes in the file. |
Move(String, Boolean)
Moves file and updates internal reference.
Calling this method will also set the IsTempFile property to False
.
Declaration
void Move(string dstFileName, bool overwrite = false)
Parameters
Type | Name | Description |
---|---|---|
String | dstFileName | Full name of the moved file. |
Boolean | overwrite | True if already existing file should be overwritten, false otherwise. |
Open()
Open an existing file stream for reading and writing.
Declaration
Stream Open()
Returns
Type | Description |
---|---|
Stream |
OpenRead()
Open a file stream for reading.
Declaration
Stream OpenRead()
Returns
Type | Description |
---|---|
Stream | Stream to the opened file. |
OpenWrite()
Open a file stream for writing, creates the file if not existing.
Declaration
Stream OpenWrite()
Returns
Type | Description |
---|---|
Stream | Stream to the opened file. |