System.IO.BinaryReader.ReadDecimal C# (CSharp) Method

ReadDecimal() public method

public ReadDecimal ( ) : decimal
return decimal
        public virtual decimal ReadDecimal()
        {
            FillBuffer(16);
            int[] ints = new int[4];
            Buffer.BlockCopy(_buffer, 0, ints, 0, 16);
            try
            {
                return new decimal(ints);
            }
            catch (ArgumentException e)
            {
                // ReadDecimal cannot leak out ArgumentException
                throw new IOException(SR.Arg_DecBitCtor, e);
            }
        }

Usage Example

Example #1
0
 public void Read(System.IO.BinaryReader reader)
 {
     this.IsNull  = false;
     catVersion   = reader.ReadInt32();
     listPrice    = reader.ReadDecimal();
     discountPlan = reader.ReadInt32();
 }
All Usage Examples Of System.IO.BinaryReader::ReadDecimal