点击或拖拽改变大小

XsFileStream 类

X#
Special Filestream class that sets the runtime IO Errorstate when an error occurs.
继承层次
Object
  MarshalByRefObject
    Stream
      FileStream
        XsFileStream
          XsBufferedFileStream
          XsWin32FileStream

命名空间:  XSharp.IO
程序集:  XSharp.Core (在 XSharp.Core.dll 中) 版本:2.22 GA
语法
 CLASS XsFileStream INHERIT FileStream
查看代码

XsFileStream 类型公开以下成员。

构造函数
  名称说明
公共方法XsFileStream
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
属性
  名称说明
公共属性FileName
The name of the file opened in the stream.
Top
方法
  名称说明
公共方法静态成员CreateFileStream
Create a XsFileStream object on Windows and a normal FileStream object on other OS-es
公共方法Flush
Clears buffers for this stream and causes any buffered data to be written to the file.
(重写 Flush.)
公共方法Flush(Boolean)
Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers.
(重写 Flush(Boolean).)
公共方法Lock
Prevents other processes from reading from or writing to the FileStream.
(重写 Lock(Int64, Int64).)
公共方法Read
Reads a block of bytes from the stream and writes the data in a given buffer.
(重写 Read(Byte, Int32, Int32).)
公共方法Seek
Sets the current position of this stream to the given value.
(重写 Seek(Int64, SeekOrigin).)
公共方法SetLength
Sets the length of this stream to the given value.
(重写 SetLength(Int64).)
公共方法Unlock
Allows access by other processes to all or part of a file that was previously locked.
(重写 Unlock(Int64, Int64).)
公共方法Write
Writes a block of bytes to the file stream.
(重写 Write(Byte, Int32, Int32).)
公共方法WriteByte
Writes a byte to the current position in the file stream.
(重写 WriteByte(Byte).)
Top
扩展方法
  名称说明
公共扩展器方法SafeLock
Locks a region in a stream. Contains TRY CATCH mechanism.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeRead(Byte)已重载。
Read data from a stream. Assumes that the whole buffer must be read. Reads from current location.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeRead(Byte, Int32)已重载。
Read data from a stream. Contains TRY CATCH mechanism. Reads from current location.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeRead(Byte, Int32, Int32)已重载。
Read data from a stream. Contains TRY CATCH mechanism. Reads from current location.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeReadAt(Int64, Byte)已重载。
Read data at a location in the file. Makes sure that file locations are >= 0. Assumes whole buffer must be read.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeReadAt(Int64, Byte, Int32)已重载。
Read data at a location in the file. Makes sure that file locations are >= 0
(由 FileStreamExensions 定义。)
公共扩展器方法SafeSetLength
Sets the length of a stream. Contains TRY CATCH mechanism.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeSetPos
Sets the location of a stream. Contains TRY CATCH mechanism. .
(由 FileStreamExensions 定义。)
公共扩展器方法SafeUnlock
Unlocks a region in a stream. Contains TRY CATCH mechanism.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeWrite(Byte)已重载。
Write data to a stream. Contains TRY CATCH mechanism. Writes to the current location. Assumes the whole buffer must be written.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeWrite(Byte, Int32)已重载。
Write data to a stream. Contains TRY CATCH mechanism. Writes to the current location.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeWriteAt(Int64, Byte)已重载。
Write data at a location in the file. Makes sure that file locations are >= 0. Assumes whole buffer must be written.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeWriteAt(Int64, Byte, Int32)已重载。
Write data at a location in the file. Makes sure that file locations are >= 0.
(由 FileStreamExensions 定义。)
公共扩展器方法SafeWriteByte
Write data to a stream. Contains TRY CATCH mechanism. Writes to the current location.
(由 FileStreamExensions 定义。)
Top
参见