Show / Hide Table of Contents

Class FSBinaryStorage

Uses the file system to store binary data.

Inheritance
System.Object
FSBinaryStorage
Implements
IBinaryStorage
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Recolude.Core.IO
Assembly: Recolude.Core.dll
Syntax
public class FSBinaryStorage : IBinaryStorage

Constructors

FSBinaryStorage()

Create a storage that will use Application.persistentDataPath to store data.

Declaration
public FSBinaryStorage()

FSBinaryStorage(String)

Create a storage that will write data to the base path provided.

Declaration
public FSBinaryStorage(string basePath)
Parameters
Type Name Description
System.String basePath

Base path for all files to be written to.

Methods

Delete(String)

Deletes the file located at the combination of base path + location provided.

Declaration
public void Delete(string location)
Parameters
Type Name Description
System.String location

Location of file.

Exists(String)

Determines whether or not a file exists at the location passed in.

Declaration
public bool Exists(string location)
Parameters
Type Name Description
System.String location

Location of file to check existance.

Returns
Type Description
System.Boolean

Whether or not the file exists.

Read(String)

Opens a stream to the file to be read. It is the responsibility of who calls this method to close the stream when they are done.

Declaration
public Stream Read(string location)
Parameters
Type Name Description
System.String location

Location of the file to open.

Returns
Type Description
System.IO.Stream

Stream to the file.

Write(Stream, String)

Writes the data found in the stream at the current seek to the location specified.

Declaration
public void Write(Stream data, string location)
Parameters
Type Name Description
System.IO.Stream data

Data to write to disk.

System.String location

Location to write data to.

Implements

IBinaryStorage
Back to top Generated by DocFX