Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Data Access Library User's Guide»Data Files and Data Streams

Data Files and Data Streams

Extreme Optimization Numerical Libraries for .NET Professional

The API for the data access classes is modeled after the File and Stream classes in the System.IO namespace of the .NET Base Class Libraries. The File class contains static methods for reading and writing to files in a single call. It also has static methods for opening files for reading or writing. These methods return streams. The Stream classes contain methods for reading and writing individual values, and allow more fine-grained control.

Likewise, for each file format we have a File-like class (DelimitedTextFile, RdataFile, MatlabFile, and so on) and a corresponding Stream-like class DelimitedTextStream, RdataStream, MatlabStream, and so on). The table below lists the classes for each format:

File format

"File" class

"Stream" class

Delimited text files

DelimitedTextFile

DelimitedTextStream

Fixed width text files

FixedWidthTextFile

FixedWidthTextStream

Matrix Market files

MatrixMarketFile

MatrixMarketStream

JSON files

JsonFile

JsonStream

Matlab® files

MatlabFile

MatlabStream

R files (.rdata)

RdataFile

RdataStream

R files (.rds)

RdsFile

RdsStream

stata® files

StataFile

StataStream

Data file classes

Each file format has a corresponding class that contains methods that perform an operation in a single call. We will use R files (with extension .rdata or .rda) as an example.

The methods defined by these classes fall into 3 general categories: reading objects, writing objects, and opening files or streams. For example, the ReadDataFrame method reads the item stored in a .rdata file into a data frame.

Data streams

The stream classes all inherit from a common base class, DataStream. There may also be an Options class that lets you specify details for a specific file format. Streams are created using one of the methods of the corresponding File class.

Some file formats support one object per file, while others may contain multiple named objects. Examples of the latter are: R files and Matlab files. For these file formats, the stream class inherits from a specialized class: CompositeDataStreamTObject. This class takes one generic type argument: the type of the objects that are stored in the file.

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.