@@ -22,7 +22,6 @@ public class BsonTranslator {
22
22
/// Handles reading a type from a stream
23
23
/// </summary>
24
24
public static Dictionary < string , object > FromStream ( Stream stream ) {
25
- BinaryReader reader = new BinaryReader ( stream ) ;
26
25
27
26
//start reading out the values
28
27
Dictionary < string , object > values = new Dictionary < string , object > ( ) ;
@@ -245,7 +244,10 @@ public static byte[] ReadBinary(Stream stream) {
245
244
246
245
//get the length and flag
247
246
int length = reader . ReadInt32 ( ) ;
248
- MongoBinaryTypes type = ( MongoBinaryTypes ) reader . ReadByte ( ) ;
247
+
248
+ //read the type identifier (we don't need to use it)
249
+ //MongoBinaryTypes type = (MongoBinaryTypes)reader.ReadByte();
250
+ reader . ReadByte ( ) ;
249
251
250
252
//then read the binary object (take in account the starting info)
251
253
return reader . ReadBytes ( length ) ;
@@ -327,9 +329,11 @@ public static string ReadString(Stream stream) {
327
329
public static string ReadCString ( Stream stream ) {
328
330
BinaryReader reader = new BinaryReader ( stream ) ;
329
331
330
- //get the length to expect - remove 4 bytes
331
- //from the count to read to account length value
332
- int length = reader . ReadInt32 ( ) ;
332
+ //get the 'length' value - Since we are currently
333
+ //reading CStrings like normal strings we don't
334
+ //actually need to use this value
335
+ //int length = reader.ReadInt32();
336
+ reader . ReadInt32 ( ) ;
333
337
334
338
//just use the typical string reading for now.
335
339
//not sure if this needs to be something special
0 commit comments