docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ChunkedStream

    Represents a stream that will flush after a certain size or time threshold.

    Inheritance
    object
    ChunkedStream
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.SimulationPro
    Assembly: Unity.SimulationPro.Capture.dll
    Syntax
    public class ChunkedStream : IDisposable

    Constructors

    ChunkedStream(int, float, Func<AsyncRequest<object>, Result>)

    Constructs a stream object.

    Declaration
    public ChunkedStream(int bufferSize = 8192, float maxElapsedSeconds = 5, Func<AsyncRequest<object>, AsyncRequest.Result> functor = null)
    Parameters
    Type Name Description
    int bufferSize

    Size of the buffer in bytes.

    float maxElapsedSeconds

    Amount of time after which the buffer will automatically flush.

    Func<AsyncRequest<object>, AsyncRequest.Result> functor

    Callback function to pass buffered data to.

    Fields

    kDefaultBufferSize

    The default stream buffer size.

    Declaration
    public const int kDefaultBufferSize = 8192
    Field Value
    Type Description
    int

    kDefaultMaxSecondsElapsed

    The default flush time in seconds.

    Declaration
    public const float kDefaultMaxSecondsElapsed = 5
    Field Value
    Type Description
    float

    Properties

    functor

    Callback functor to call when flush occurs. Accumulated data thus far is passed to functor.

    Declaration
    public Func<AsyncRequest<object>, AsyncRequest.Result> functor { get; set; }
    Property Value
    Type Description
    Func<AsyncRequest<object>, AsyncRequest.Result>

    Methods

    Append(byte[])

    Append the data to the byte buffer

    Declaration
    public void Append(byte[] data)
    Parameters
    Type Name Description
    byte[] data

    byte array of the data to be appended.

    Dispose()

    Disposes of the stream and removes it from Tick.

    Declaration
    public void Dispose()

    Flush(bool)

    Write the data in the buffer to the file system.

    Declaration
    public void Flush(bool synchronous = false)
    Parameters
    Type Name Description
    bool synchronous

    Whether data collection should be performed synchronously.

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)