Search Results for

    Show / Hide Table of Contents

    Class BinaryFile

    A convenience wrapper for arbitrary data. This is a reusable, read-only wrapper around the original file that is used throughout this library. A BinaryFile can be created using the static builder methods From(String) or From(Byte[]). Once a BinaryFile has been created, the contents cannot be changed.

    Inheritance
    System.Object
    BinaryFile
    Namespace: PTIRelianceLib
    Assembly: PTIRelianceLib.dll
    Syntax
    public sealed class BinaryFile : object

    Properties

    | Improve this Doc View Source

    Empty

    Returns true if this BinaryFile is empty

    Declaration
    public bool Empty { get; }
    Property Value
    Type Description
    System.Boolean

    True if no data is in this BinaryFile

    | Improve this Doc View Source

    Item[Int32]

    Read-only indexer

    Declaration
    public byte this[int key] { get; }
    Parameters
    Type Name Description
    System.Int32 key

    Index to read

    Property Value
    Type Description
    System.Byte

    byte value at index key

    | Improve this Doc View Source

    Length

    Returns the length in bytes of this file

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    System.Int32

    Integer length of data in this BinaryFile in bytes

    | Improve this Doc View Source

    LongLength

    Returns the length in bytes of this file

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

    Long length of data in this BinaryFile in bytes

    Methods

    | Improve this Doc View Source

    From(Byte[])

    Construct a BinaryFile from a buffer in memory.

    Declaration
    public static BinaryFile From(byte[] buffer)
    Parameters
    Type Name Description
    System.Byte[] buffer

    Memory to copy into a new BinaryFile

    Returns
    Type Description
    BinaryFile

    BinaryFile

    | Improve this Doc View Source

    From(String)

    Construct a BinaryFile from a physical file location at path.

    Declaration
    public static BinaryFile From(string path)
    Parameters
    Type Name Description
    System.String path

    Path to source file

    Returns
    Type Description
    BinaryFile

    BinaryFile contains data from path. If the file cannot be read, the result will be empty.

    | Improve this Doc View Source

    GetData()

    Returns a copy of this data

    Declaration
    public byte[] GetData()
    Returns
    Type Description
    System.Byte[]

    byte[]

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 Pyramid Technologies
    Generated by DocFX