[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.Storage.NativeFileStream

Class NativeFileStream

Namespace
GrapeCity.Documents.DX.Storage
Assembly
GcDocs.DX.Windows.dll

Windows File Helper.

public class NativeFileStream : Stream, IDisposable
Inheritance
object
System.MarshalByRefObject
System.IO.Stream
NativeFileStream
Implements
System.IDisposable
Inherited Members
System.IO.Stream.Null
System.IO.Stream.CopyToAsync(System.IO.Stream)
System.IO.Stream.CopyToAsync(System.IO.Stream, int)
System.IO.Stream.CopyToAsync(System.IO.Stream, int, System.Threading.CancellationToken)
System.IO.Stream.CopyTo(System.IO.Stream)
System.IO.Stream.CopyTo(System.IO.Stream, int)
System.IO.Stream.Close()
System.IO.Stream.Dispose()
System.IO.Stream.FlushAsync()
System.IO.Stream.FlushAsync(System.Threading.CancellationToken)
System.IO.Stream.CreateWaitHandle()
System.IO.Stream.BeginRead(byte[], int, int, System.AsyncCallback, object)
System.IO.Stream.EndRead(System.IAsyncResult)
System.IO.Stream.ReadAsync(byte[], int, int)
System.IO.Stream.ReadAsync(byte[], int, int, System.Threading.CancellationToken)
System.IO.Stream.BeginWrite(byte[], int, int, System.AsyncCallback, object)
System.IO.Stream.EndWrite(System.IAsyncResult)
System.IO.Stream.WriteAsync(byte[], int, int)
System.IO.Stream.WriteAsync(byte[], int, int, System.Threading.CancellationToken)
System.IO.Stream.ReadByte()
System.IO.Stream.WriteByte(byte)
System.IO.Stream.Synchronized(System.IO.Stream)
System.IO.Stream.ObjectInvariant()
System.IO.Stream.CanTimeout
System.IO.Stream.ReadTimeout
System.IO.Stream.WriteTimeout
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(bool)
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

NativeFileStream(string, NativeFileMode, NativeFileAccess, NativeFileShare)

Initializes a new instance of the NativeFileStream class.

public NativeFileStream(string fileName, NativeFileMode fileMode, NativeFileAccess access, NativeFileShare share = NativeFileShare.Read)

Parameters

fileName string

Name of the file.

fileMode NativeFileMode

The file mode.

access NativeFileAccess

The access mode.

share NativeFileShare

The share mode.

Properties

CanRead

public override bool CanRead { get; }

Property Value

bool

CanSeek

public override bool CanSeek { get; }

Property Value

bool

CanWrite

public override bool CanWrite { get; }

Property Value

bool

Handle

Gets the stream handle.

public IntPtr Handle { get; }

Property Value

System.IntPtr

Length

public override long Length { get; }

Property Value

long

Position

public override long Position { get; set; }

Property Value

long

Methods

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

Flush()

public override void Flush()

Read(byte[], int, int)

public override int Read(byte[] buffer, int offset, int count)

Parameters

buffer byte[]
offset int
count int

Returns

int

Read(IntPtr, int, int)

Reads a block of bytes from the stream and writes the data in a given buffer.

public int Read(IntPtr buffer, int offset, int count)

Parameters

buffer System.IntPtr

When this method returns, contains the specified buffer with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.

offset int

The byte offset in array at which the read bytes will be placed.

count int

The maximum number of bytes to read.

Returns

int

The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached.

Exceptions

System.ArgumentNullException

array is null.

Seek(long, SeekOrigin)

public override long Seek(long offset, SeekOrigin origin)

Parameters

offset long
origin System.IO.SeekOrigin

Returns

long

SetLength(long)

public override void SetLength(long value)

Parameters

value long

Write(byte[], int, int)

public override void Write(byte[] buffer, int offset, int count)

Parameters

buffer byte[]
offset int
count int

Write(IntPtr, int, int)

Writes a block of bytes to this stream using data from a buffer.

public void Write(IntPtr buffer, int offset, int count)

Parameters

buffer System.IntPtr

The buffer containing data to write to the stream.

offset int

The zero-based byte offset in buffer at which to begin copying bytes to the current stream.

count int

The number of bytes to be written to the current stream.