TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface IDataStreamOps in Tinman.Core.IO.Streams

Defines common operations for IDataStream objects.

interface IDataStreamOps extends ITextStreamFactory
  base of IDataStream

Methods

Background

Uses a background thread to prefetch data from this data stream.

[OwnerReturn, OwnerThis]
method Background (int32 bufferSize = 65536, int32 bufferCount = 16)
type IDataStream
params bufferSize [>0] The buffer size, in bytes. Defaults to 65536.
  bufferCount [>0] The buffer count. Defaults to 16.
returns [not-null] The sequential read-only data stream.

Remarks:

If this data stream is already being prefetched in a background thread, this method may return this.

The resulting data stream does not support seeking (i.e. CanSeek returns false) and it will be in read-only ( CanRead) mode.

Buffer

Wraps this data stream in a buffered stream.

[OwnerReturn, OwnerThis]
method Buffer (int32 bufferSize = 65536)
type IDataStream
params bufferSize [>0] The buffer size, in bytes. Defaults to 65536.
returns [not-null] The buffered data stream.

Remarks:

If this data stream is already buffered in memory, this method may return this.

If both read and write operations are going to be used on the returned stream, seeking must be supported by this stream (see CanSeek).

ReadToEnd

Reads all remaining data from this stream and disposes it.

[OwnerReturn, OwnerThis]
method ReadToEnd ()
type ByteBuffer
returns [not-null] The read bytes.

ToFile

Converts this data stream into a random-access file.

[OwnerReturn, OwnerThis]
method ToFile ()
type IFile
returns [not-null] The data file.

Remarks:

It may be necessary to copy the data stream bytes to a temporary file.

ToTextStream

Creates an ITextStream from the data of this object.

[OwnerReturn, OwnerThis]
method ToTextStream (CharacterEncoding encoding)
type ITextStream
params encoding [not-null] The character encoding to use.
returns [not-null] The data stream.
inherited ITextStreamFactory.ToTextStream