Click or drag to resize

XsFileStream Class

X#
Special Filestream class that sets the runtime IO Errorstate when an error occurs.
Inheritance Hierarchy
Object
  MarshalByRefObject
    Stream
      FileStream
        XsFileStream
          XsBufferedFileStream
          XsWin32FileStream

Namespace:  XSharp.IO
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 CLASS XsFileStream INHERIT FileStream
Request Example View Source

The XsFileStream type exposes the following members.

Constructors
  NameDescription
Public methodXsFileStream
Initializes a new instance of the FileStream class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, and additional file options.
Top
Properties
  NameDescription
Public propertyFileName
The name of the file opened in the stream.
Top
Methods
  NameDescription
Public methodStatic memberCreateFileStream
Create a XsFileStream object on Windows and a normal FileStream object on other OS-es
Public methodFlush
Clears buffers for this stream and causes any buffered data to be written to the file.
(Overrides Flush.)
Public methodFlush(Logic)
Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers.
(Overrides Flush(Logic).)
Public methodLock
Prevents other processes from reading from or writing to the FileStream.
(Overrides Lock(Int64, Int64).)
Public methodRead
Reads a block of bytes from the stream and writes the data in a given buffer.
(Overrides Read(Byte, Long, Long).)
Public methodSeek
Sets the current position of this stream to the given value.
(Overrides Seek(Int64, SeekOrigin).)
Public methodSetLength
Sets the length of this stream to the given value.
(Overrides SetLength(Int64).)
Public methodUnlock
Allows access by other processes to all or part of a file that was previously locked.
(Overrides Unlock(Int64, Int64).)
Public methodWrite
Writes a block of bytes to the file stream.
(Overrides Write(Byte, Long, Long).)
Public methodWriteByte
Writes a byte to the current position in the file stream.
(Overrides WriteByte(Byte).)
Top
Extension Methods
  NameDescription
Public Extension MethodSafeLock
Locks a region in a stream. Contains TRY CATCH mechanism.
(Defined by FileStreamExensions.)
Public Extension MethodSafeRead(Byte)Overloaded.
Read data from a stream. Assumes that the whole buffer must be read. Reads from current location.
(Defined by FileStreamExensions.)
Public Extension MethodSafeRead(Byte, Long)Overloaded.
Read data from a stream. Contains TRY CATCH mechanism. Reads from current location.
(Defined by FileStreamExensions.)
Public Extension MethodSafeRead(Byte, Long, Long)Overloaded.
Read data from a stream. Contains TRY CATCH mechanism. Reads from current location.
(Defined by FileStreamExensions.)
Public Extension MethodSafeReadAt(Int64, Byte)Overloaded.
Read data at a location in the file. Makes sure that file locations are >= 0. Assumes whole buffer must be read.
(Defined by FileStreamExensions.)
Public Extension MethodSafeReadAt(Int64, Byte, Long)Overloaded.
Read data at a location in the file. Makes sure that file locations are >= 0
(Defined by FileStreamExensions.)
Public Extension MethodSafeSetLength
Sets the length of a stream. Contains TRY CATCH mechanism.
(Defined by FileStreamExensions.)
Public Extension MethodSafeSetPos
Sets the location of a stream. Contains TRY CATCH mechanism. .
(Defined by FileStreamExensions.)
Public Extension MethodSafeUnlock
Unlocks a region in a stream. Contains TRY CATCH mechanism.
(Defined by FileStreamExensions.)
Public Extension MethodSafeWrite(Byte)Overloaded.
Write data to a stream. Contains TRY CATCH mechanism. Writes to the current location. Assumes the whole buffer must be written.
(Defined by FileStreamExensions.)
Public Extension MethodSafeWrite(Byte, Long)Overloaded.
Write data to a stream. Contains TRY CATCH mechanism. Writes to the current location.
(Defined by FileStreamExensions.)
Public Extension MethodSafeWriteAt(Int64, Byte)Overloaded.
Write data at a location in the file. Makes sure that file locations are >= 0. Assumes whole buffer must be written.
(Defined by FileStreamExensions.)
Public Extension MethodSafeWriteAt(Int64, Byte, Long)Overloaded.
Write data at a location in the file. Makes sure that file locations are >= 0.
(Defined by FileStreamExensions.)
Public Extension MethodSafeWriteByte
Write data to a stream. Contains TRY CATCH mechanism. Writes to the current location.
(Defined by FileStreamExensions.)
Top
See Also