Search Results for

    Show / Hide Table of Contents

    Interface IFileStream

    A file stream.

    Namespace: FM.LiveSwitch
    Assembly: FM.LiveSwitch.dll
    Syntax
    public interface IFileStream

    Properties

    Length

    Gets the file stream length (must be opened first).

    Declaration
    long Length { get; }
    Property Value
    Type Description
    System.Int64

    Path

    Gets the path.

    Declaration
    string Path { get; }
    Property Value
    Type Description
    System.String

    Position

    Gets or sets the position in the file stream.

    Declaration
    long Position { get; set; }
    Property Value
    Type Description
    System.Int64

    Methods

    Close()

    Closes the file stream.

    Declaration
    void Close()

    Exists()

    Returns a boolean value indicating whether the file exists.

    Declaration
    bool Exists()
    Returns
    Type Description
    System.Boolean

    Flush()

    Flushes the file stream.

    Declaration
    bool Flush()
    Returns
    Type Description
    System.Boolean

    Open(FileStreamAccess)

    Opens the file stream.

    Declaration
    void Open(FileStreamAccess access)
    Parameters
    Type Name Description
    FileStreamAccess access

    The access requirement.

    Read(Byte[], Int32, Int32)

    Reads data from the file stream.

    Declaration
    int Read(byte[] data, int index, int length)
    Parameters
    Type Name Description
    System.Byte[] data

    The buffer to fill with data from the file.

    System.Int32 index

    The index at which to start writing.

    System.Int32 length

    The maximum number of bytes to read.

    Returns
    Type Description
    System.Int32

    The number of bytes read from the file.

    Write(Byte[], Int32, Int32)

    Writes data to the file stream.

    Declaration
    bool Write(byte[] data, int index, int length)
    Parameters
    Type Name Description
    System.Byte[] data

    The data to write.

    System.Int32 index

    The index at which to start reading.

    System.Int32 length

    The number of bytes to write.

    Returns
    Type Description
    System.Boolean

    true if the data was written; otherwise, false.

    WriteTo(Int32, Byte[], Int32, Int32)

    Writes data to the file stream.

    Declaration
    bool WriteTo(int location, byte[] data, int index, int length)
    Parameters
    Type Name Description
    System.Int32 location

    The location to write to.

    System.Byte[] data

    The data to write to the file.

    System.Int32 index

    The index at which to start reading.

    System.Int32 length

    The number of bytes to write.

    Returns
    Type Description
    System.Boolean

    true if the data was written; otherwise, false.

    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved. Doc build for LiveSwitch v1.15.0