Beispiel #1
0
 public static decimal?ReadCompressedNullableDecimal(this IReadBytes stream)
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadCompressedDecimal());
 }
 public static long?ReadCompressedNullableLong(this IReadBytes stream)
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadCompressedLong());
 }
Beispiel #3
0
 public static MonthStamp?ReadCompressedNullableMonthStamp(this IReadBytes stream)
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadCompressedMonthStamp());
 }
Beispiel #4
0
 public static T?ReadCompressedNullableEnum <T>(this IReadBytes stream) where T : struct, Enum
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadCompressedEnum <T>());
 }
 public static uint?ReadCompressedNullableUInt(this IReadBytes stream)
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadCompressedUInt());
 }
Beispiel #6
0
 public static double?ReadNullableFullDouble(this IReadBytes stream)
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadFullDouble());
 }
Beispiel #7
0
 public static DateTime?ReadCompressedNullableDateTime(this IReadBytes stream)
 {
     if (!stream.ReadCompressedBool())
     {
         return(null);
     }
     return(stream.ReadCompressedDateTime());
 }
        public static byte[] ReadCompressedByteArray(this IReadBytes stream)
        {
            if (!stream.ReadCompressedBool())
            {
                return(null);
            }
            var length = (int)stream.ReadCompressedUInt();

            return(stream.ReadBytes(length));
        }
Beispiel #9
0
        public static string ReadCompressedString(this IReadBytes stream)
        {
            if (!stream.ReadCompressedBool())
            {
                return(null);
            }
            var length = (int)UIntCompressor.ReadCompressedUInt(stream);
            var bytes  = new byte[length];

            stream.ReadBytes(bytes, 0, length);
            return(Encoding.GetString(bytes));
        }