@@ -263,6 +263,7 @@ public byte ReadNibble()
263263 ) ;
264264 }
265265
266+ public sbyte ReadSByte ( ) => ( sbyte ) ReadByte ( ) ;
266267 /// <summary>
267268 /// Read an unsigned short (UInt16) from the stream.
268269 /// </summary>
@@ -821,25 +822,25 @@ public uint[] ReadUIntArrayDiff(uint[] readTo = null, long knownLength = -1)
821822 public ValueType ReadValueType < T > ( )
822823 {
823824 if ( typeof ( T ) == typeof ( float ) )
824- return ReadFloat ( ) ;
825+ return ReadSingle ( ) ;
825826 else if ( typeof ( T ) == typeof ( double ) )
826827 return ReadDouble ( ) ;
827828 else if ( typeof ( T ) == typeof ( byte ) )
828829 return ReadByte ( ) ;
829830 else if ( typeof ( T ) == typeof ( sbyte ) )
830831 return ReadSByte ( ) ;
831832 else if ( typeof ( T ) == typeof ( short ) )
832- return ReadShort ( ) ;
833+ return ReadInt16 ( ) ;
833834 else if ( typeof ( T ) == typeof ( ushort ) )
834- return ReadUShort ( ) ;
835+ return ReadUInt16 ( ) ;
835836 else if ( typeof ( T ) == typeof ( int ) )
836- return ReadInt ( ) ;
837+ return ReadInt32 ( ) ;
837838 else if ( typeof ( T ) == typeof ( uint ) )
838- return ReadUInt ( ) ;
839+ return ReadUInt32 ( ) ;
839840 else if ( typeof ( T ) == typeof ( long ) )
840- return ReadLong ( ) ;
841+ return ReadInt64 ( ) ;
841842 else if ( typeof ( T ) == typeof ( ulong ) )
842- return ReadULong ( ) ;
843+ return ReadUInt64 ( ) ;
843844
844845 return default ( ValueType ) ;
845846 }
@@ -860,36 +861,8 @@ public T ReadValueTypeOrString<T>()
860861 return default ( T ) ;
861862 }
862863 }
863-
864- public bool ReadBool ( )
865- {
866- if ( knownLength < 0 ) knownLength = ( long ) ReadUInt64Packed ( ) ;
867- uint [ ] writeTo = readTo == null || readTo . LongLength != knownLength ? new uint [ knownLength ] : readTo ;
868- ulong data = bitSource . BitPosition + ( ulong ) ( readTo == null ? 0 : Math . Min ( knownLength , readTo . LongLength ) ) ;
869- ulong rset ;
870- long readToLength = readTo == null ? 0 : readTo . LongLength ;
871- for ( long i = 0 ; i < knownLength ; ++ i )
872- {
873- if ( i >= readToLength || ReadBit ( ) )
874- {
875- #if ARRAY_WRITE_PREMAP
876- // Move to data section
877- rset = bitSource . BitPosition ;
878- bitSource . BitPosition = data ;
879- #endif
880- // Read datum
881- writeTo [ i ] = ReadUInt32Packed ( ) ;
882- #if ARRAY_WRITE_PREMAP
883- // Return to mapping section
884- data = bitSource . BitPosition ;
885- bitSource . BitPosition = rset ;
886- #endif
887- }
888- else if ( i < readTo . LongLength ) writeTo [ i ] = readTo [ i ] ;
889- }
890- bitSource . BitPosition = data ;
891- return writeTo ;
892- }
864+
865+ public bool ReadBool ( ) => ReadBit ( ) ;
893866
894867 public long [ ] ReadLongArray ( long [ ] readTo = null , long knownLength = - 1 )
895868 {
0 commit comments