Skip to content

Commit 928a30a

Browse files
committed
Change custom BitWriter/BitReader types to use streams instead.
1 parent d39cc7d commit 928a30a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

MLAPI/NetworkingManagerComponents/Binary/BitReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public object ReadObjectPacked(Type type)
130130
if (type == typeof(IBitWritable))
131131
{
132132
object instance = Activator.CreateInstance(type);
133-
((IBitWritable)instance).Read(this);
133+
((IBitWritable)instance).Read(this.source);
134134
return instance;
135135
}
136136
if (type.IsEnum)

MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void WriteObjectPacked(object value)
147147
}
148148
else if(value is IBitWritable)
149149
{
150-
((IBitWritable)value).Write(this);
150+
((IBitWritable)value).Write(this.sink);
151151
return;
152152
}
153153
else if (value.GetType().IsEnum)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34
using System.Linq;
45
using System.Text;
56

67
namespace MLAPI.Serialization
78
{
89
public interface IBitWritable
910
{
10-
void Write(BitWriter writer);
11-
void Read(BitReader reader);
11+
void Write(Stream stream);
12+
void Read(Stream stream);
1213
}
1314
}

0 commit comments

Comments
 (0)