public static ProfilerContainer FromBytes(byte[] bytes) { ProfilerContainer container = new ProfilerContainer(); BitStream stream = new BitStream(bytes); BitReader reader = new BitReader(stream); ushort count = reader.ReadUInt16Packed(); container.ticks = new ProfilerTick[count]; for (int i = 0; i < count; i++) { container.ticks[i] = ProfilerTick.FromStream(stream); } return(container); }
public static ProfilerContainer FromBytes(byte[] bytes) { var container = new ProfilerContainer(); var buffer = new NetworkBuffer(bytes); var reader = new NetworkReader(buffer); var count = reader.ReadUInt16Packed(); container.Ticks = new ProfilerTick[count]; for (int i = 0; i < count; i++) { container.Ticks[i] = ProfilerTick.FromStream(buffer); } return(container); }