/// <summary> /// /// </summary> protected void ReadLeadingByte() { var data = Stream.ReadByte(); if (-1 == data) { throw new HessianSerializerException(); } LeadingByte = new LeadingByte((byte)data); }
internal static bool IsFalse(this LeadingByte lb) => Marker.False == lb.Value;
internal static bool IsLongObjectReference(this LeadingByte lb) => Marker.ClassReference == lb.Value;
internal static bool IsCompactDateTime(this LeadingByte lb) => Marker.DateTimeCompact == lb.Value;
internal static bool IsClassDefinition(this LeadingByte lb) => Marker.ClassDefinition == lb.Value;
internal static bool IsUnpackedDouble(this LeadingByte lb) => Marker.Double == lb.Value;
internal static bool IsCompactString(this LeadingByte lb) => 0x30 <= lb.Value && lb.Value <= 0x33;
internal static bool IsShortInt64(this LeadingByte lb) => 0xF0 <= lb.Value && lb.Value <= 0xFF;
internal static bool IsCompactInt64(this LeadingByte lb) => 0x38 <= lb.Value && lb.Value <= 0x3F;
internal static bool IsUnpackedInt32(this LeadingByte lb) => Marker.UnpackedInteger == lb.Value;
internal static bool IsTinyInt64(this LeadingByte lb) => 0xD8 <= lb.Value && lb.Value <= 0xEF;
internal static bool IsCompactInt32(this LeadingByte lb) => 0xD0 <= lb.Value && lb.Value <= 0xD7;
internal static bool IsShortInt32(this LeadingByte lb) => 0xC0 <= lb.Value && lb.Value <= 0xCF;
internal static bool IsTinyInt32(this LeadingByte lb) => 0x80 <= lb.Value && lb.Value <= 0xBF;
internal static bool IsNull(this LeadingByte lb) => Marker.Null == lb.Value;
internal static bool IsUnpackedInt64(this LeadingByte lb) => Marker.UnpackedLong == lb.Value;
internal static bool IsCompactDouble(this LeadingByte lb) => Marker.DoubleFloat == lb.Value;
internal static bool IsCompactBinary(this LeadingByte lb) => 0x20 <= lb.Value && lb.Value <= 0x2f;
internal static bool IsTinyString(this LeadingByte lb) => lb.Value <= 0x1F;
internal static bool IsFinalChunkBinary(this LeadingByte lb) => Marker.BinaryFinalChunk == lb.Value;
internal static bool IsFinalChunkString(this LeadingByte lb) => Marker.StringFinalChunk == lb.Value;
internal static bool IsZeroDouble(this LeadingByte lb) => Marker.DoubleZero == lb.Value;
internal static bool IsUnpackedDateTime(this LeadingByte lb) => Marker.DateTimeLong == lb.Value;
internal static bool IsOneDouble(this LeadingByte lb) => Marker.DoubleOne == lb.Value;
internal static bool IsShortObjectReference(this LeadingByte lb) => 0x60 <= lb.Value && lb.Value <= 0x6F;
internal static bool IsTinyDouble(this LeadingByte lb) => Marker.DoubleOctet == lb.Value;
internal static bool IsInstanceReference(this LeadingByte lb) => Marker.InstanceReference == lb.Value;
internal static bool IsShortDouble(this LeadingByte lb) => Marker.DoubleShort == lb.Value;
/// <summary> /// /// </summary> /// <param name="stream"></param> public HessianInputReader(Stream stream) : base(stream) { LeadingByte = LeadingByte.Empty; }
internal static bool IsTrue(this LeadingByte lb) => Marker.True == lb.Value;