docs.unity3d.com
    Show / Hide Table of Contents

    Class ChunkedStream

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

    Inheritance
    Object
    ChunkedStream
    Namespace: Unity.Simulation
    Syntax
    public class ChunkedStream : IDisposable

    Constructors

    ChunkedStream(Int32, Single, Func<AsyncRequest<Object>, AsyncRequest.Result>)

    Constructs a stream object.

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

    Size of the buffer in bytes.

    Single 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
    Int32

    kDefaultMaxSecondsElapsed

    The default flush time in seconds.

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

    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(Boolean)

    Write the data in the buffer to the file system.

    Declaration
    public void Flush(bool synchronous = false)
    Parameters
    Type Name Description
    Boolean synchronous
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023