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.
@@ -284,13 +301,10 @@ public void WriteBit(bool bit)
284
301
/// <param name="value">Value to write</param>
285
302
publicvoidWriteSingle(floatvalue)
286
303
{
287
-
lock(holder_f)
288
-
lock(holder_i)
289
-
{
290
-
holder_f[0]=value;
291
-
Buffer.BlockCopy(holder_f,0,holder_i,0,4);
292
-
WriteUInt32(holder_i[0]);
293
-
}
304
+
UIntFloatconversion=newUIntFloat();
305
+
conversion.floatValue=value;
306
+
uintbinary=conversion.intValue;
307
+
WriteUInt32(binary);
294
308
}
295
309
296
310
/// <summary>
@@ -299,8 +313,10 @@ public void WriteSingle(float value)
299
313
/// <param name="value">Value to write</param>
300
314
publicvoidWriteDouble(doublevalue)
301
315
{
302
-
longbinary=BitConverter.DoubleToInt64Bits(value);
303
-
WriteInt64(binary);
316
+
UIntFloatconversion=newUIntFloat();
317
+
conversion.doubleValue=value;
318
+
ulongbinary=conversion.longValue;
319
+
WriteUInt64(binary);
304
320
305
321
}
306
322
@@ -310,13 +326,10 @@ public void WriteDouble(double value)
0 commit comments