TinyFileStream Class
Namespace: GHIElectronics.TinyCLR.IO.TinyFileSystem · Assembly: GHIElectronics.TinyCLR.IO.TinyFileSystem
Provides a stream for a file in the Tiny File System.
public class TinyFileStream : Stream
Properties
CanRead
public override bool CanRead { get; }
Gets a value indicating whether the current stream supports reading.
CanSeek
public override bool CanSeek { get; }
Gets a value indicating whether the current stream supports seeking.
CanWrite
public override bool CanWrite { get; }
Gets a value indicating whether the current stream supports writing.
Length
public override long Length { get; }
Gets length of bytes in the stream.
Position
public override long Position { get; set; }
Gets or sets the current possition in the stream.
Methods
Flush()
public override void Flush()
Writes unwritten data to the file.
Read(byte[] array, int offset, int count)
public override int Read(byte[] array, int offset, int count)
Reads a block of bytes from the stream.
| Parameter | Type | Description |
|---|---|---|
array | byte[] | The array to fill with the data read from the file. |
offset | int | The byte offset in the array at which read bytes will be placed. |
count | int | The maximun number of bytes to read. |
Returns int
Seek(long offset, SeekOrigin origin)
public override long Seek(long offset, SeekOrigin origin)
Sets the current position of this stream to a given value.
| Parameter | Type | Description |
|---|---|---|
offset | long | The offset of the positon relative to the origin. |
origin | SeekOrigin | Specified the beginning, end or current postion as a reference point to apply the offset. |
Returns long — The new postion in the stream.
SetLength(long value)
public override void SetLength(long value)
Sets the length of this stream to a given value.
| Parameter | Type | Description |
|---|---|---|
value | long | The new length of the stream |
Write(byte[] array, int offset, int count)
public override void Write(byte[] array, int offset, int count)
Writes a block of bytes to the file stream.
| Parameter | Type | Description |
|---|---|---|
array | byte[] | The buffer containing the data to write to the stream. |
offset | int | The byte offset in the array from which to start writing bytes to the stream. |
count | int | The number of bytes to write. |
Dispose(bool disposing)
protected override void Dispose(bool disposing)
Dispose the TinyFileStream.
| Parameter | Type | Description |
|---|---|---|
disposing | bool | true if being disposed from a call to Dispose otherwise false if called from the finalizer. |