You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// A stream that supports writing data smaller than a single byte. This stream also has a built-in compression algorithm that can (optionally) be used to write compressed data.
@@ -292,13 +311,10 @@ public void WriteBit(bool bit)
292
311
/// <param name="value">Value to write</param>
293
312
publicvoidWriteSingle(floatvalue)
294
313
{
295
-
lock(holder_f)
296
-
lock(holder_i)
297
-
{
298
-
holder_f[0]=value;
299
-
Buffer.BlockCopy(holder_f,0,holder_i,0,4);
300
-
WriteUInt32(holder_i[0]);
301
-
}
314
+
WriteUInt32(newUIntFloat
315
+
{
316
+
floatValue=value
317
+
}.uintValue);
302
318
}
303
319
304
320
/// <summary>
@@ -307,13 +323,10 @@ public void WriteSingle(float value)
307
323
/// <param name="value">Value to write</param>
308
324
publicvoidWriteDouble(doublevalue)
309
325
{
310
-
lock(holder_d)
311
-
lock(holder_l)
312
-
{
313
-
holder_d[0]=value;
314
-
Buffer.BlockCopy(holder_d,0,holder_l,0,8);
315
-
WriteUInt64(holder_l[0]);
316
-
}
326
+
WriteUInt64(newUIntFloat
327
+
{
328
+
doubleValue=value
329
+
}.ulongValue);
317
330
}
318
331
319
332
/// <summary>
@@ -322,13 +335,10 @@ public void WriteDouble(double value)
0 commit comments