docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
Show / Hide Table of Contents
    • AddCollectorMenuAttribute
  • Unity.Simulation
    • AggregatedSample
    • AggregationEvent
    • ArrayCast
    • ArrayUtilities
    • AsyncRequest
    • AsyncRequest.ExecutionContext
    • AsyncRequest.Result
    • AsyncRequest.State
    • AsyncRequest<T>
    • BaseDataConsumer<T>
    • BaseDataConsumer<T>.Uploadable
    • Category
    • ChunkedStream
    • ChunkedUnityLog
    • CollectorBase
    • CollectorBase.ConsumeCollectorReport
    • CollectorElement
    • CollectorsBaseEditor
    • CollectorsList
    • Configuration
    • Configuration.SimulationConfiguration
    • ContentType
    • ContinuousEvents
    • ContinuousEvents.EventCollectionDelegate
    • ContinuousEvents.EventDispatchDelegate
    • CoreProfilerUtils
    • CounterEvent
    • CounterEventData
    • DXChunkedStream
    • DXChunkedUnityLog
    • DXFile
    • DXFormat
    • DXManager
    • DXTimeLogger
    • DataCapturePaths
    • DirectoryNameComponent
    • Dispatcher
    • EventBase
    • ExecUtility
    • ExitPlaymode
    • ExtensionNameComponent
    • FileNameComponent
    • FileProducer
    • Format
    • FrameCountCondition
    • FrameLimit
    • FrameNumberNameComponent
    • ICondition
    • IDataProduced
    • IGlobalProfilerDataDispatcher
    • IgnoreCollectorAttribute
    • LabelNameComponent
    • LambdaJob
    • LambdaJob.DelegateType
    • Log
    • Log.Level
    • Manager
    • Manager.NotificationDelegate
    • Manager.TickDelegate
    • NameComponent
    • NameGenerator
    • Options
    • PackageImportTests
    • PathUtility
    • PerfStatsManager
    • PlayerResolution
    • PlayerResolutionSettings
    • ProfilerManager
    • ProfilerProperties
    • ProfilerReport
    • ProfilerSamplingEvent
    • ReportingUtils
    • Sample
    • SampleProfilerCollector
    • SequenceNameComponent
    • SequencedPathName
    • SignedURLDataConsumer
    • SimSecondsCondition
    • SimulationProfiler
    • SimulationProfilerBase
    • SimulationProfilerEditor
    • TestUtility
    • ThreadUtility
    • TimeLimit
    • TimeLogger
    • TimeScale
    • TimeScaleEditor
    • TimeUtility
    • Timer
    • TimerSource
    • TimestampNameComponent
    • WallSecondsCondition

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.Simulation
Assembly: Unity.Simulation.Core.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

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