Click or drag to resize

XsBufferedFileStream Class

X#
This class performs buffered IO to files opened exclusively
Inheritance Hierarchy
Object
  MarshalByRefObject
    Stream
      FileStream
        XsFileStream
          XsBufferedFileStream

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

The XsBufferedFileStream type exposes the following members.

Constructors
  NameDescription
Public methodXsBufferedFileStream
Initializes a new instance of the XsBufferedFileStream class
Top
Properties
  NameDescription
Public propertyFileName
The name of the file opened in the stream.
(Inherited from XsFileStream.)
Public propertyLength
Gets the length in bytes of the stream.
(Overrides Length.)
Public propertyPosition
Gets or sets the current position of this stream.
(Overrides Position.)
Top
Methods
  NameDescription
Public methodClose
Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.
(Overrides Close.)
Public methodFlush
Clears buffers for this stream and causes any buffered data to be written to the file.
(Inherited from XsFileStream.)
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.
(Inherited from XsFileStream.)
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.
(Inherited from XsFileStream.)
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).)
Public methodXRead
Bypass the buffered Read mechanism and call the original Read() method in the base class
Public methodXWrite
Bypass the buffered Write mechanism and call the original Write() method in the base class
Top
Fields
  NameDescription
Public fieldStatic memberBUFF_MASK
Public fieldStatic memberBUFF_SIZE
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