implement boolean, and do not write anything if value is null

This commit is contained in:
Michael Becker 2022-08-06 19:15:23 -04:00
parent 8a6be2a5d7
commit 94aeb3e754
No known key found for this signature in database
GPG Key ID: DA394832305DA332

View File

@ -609,6 +609,9 @@ namespace UniversalEditor.IO
/// <exception cref="System.ObjectDisposedException">The stream is closed.</exception>
public void WriteObject(object value)
{
if (value == null)
return;
if (value is object[])
{
object[] array = (object[])value;
@ -621,7 +624,12 @@ namespace UniversalEditor.IO
Type objectType = value.GetType();
if (objectType == typeof(Byte))
if (objectType == typeof(Boolean))
{
WriteBoolean((bool)value);
return;
}
else if (objectType == typeof(Byte))
{
WriteByte((byte)value);
return;