public virtual void Test4() { NeoDatis.Odb.Core.Layers.Layer3.Engine.IByteArrayConverter byteArrayConverter = NeoDatis.Odb.OdbConfiguration .GetCoreProvider().GetByteArrayConverter(); NeoDatis.Odb.Core.Transaction.IWriteAction wa1 = new NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction (1, byteArrayConverter.IntToByteArray(1), "size"); AssertEquals(wa1.GetBytes(0).Length, 4); NeoDatis.Odb.Core.Transaction.IWriteAction wa2 = new NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction (1, byteArrayConverter.StringToByteArray("ol√° chico", true, -1, true), "size"); NeoDatis.Odb.Core.Transaction.IWriteAction wa3 = new NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction (1, byteArrayConverter.BigDecimalToByteArray(new System.Decimal(1.123456789), true), "size"); }
public virtual void WriteBigDecimal(System.Decimal d, bool writeInTransaction) { byte[] bytes = byteArrayConverter.BigDecimalToByteArray(d, true); if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId) && canLog) { NeoDatis.Tool.DLogger.Debug("writing BigDecimal " + d + " at " + GetPosition()); } if (!writeInTransaction) { io.WriteBytes(bytes); } else { GetSession().GetTransaction().ManageWriteAction(io.GetCurrentPosition(), bytes); EnsureSpaceFor(bytes.Length, NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.BigDecimal ); } bytes = null; }
public virtual void TestBigDecimal1() { System.Decimal bd1 = new System.Decimal(10); byte[] b2 = byteArrayConverter.BigDecimalToByteArray(bd1, true); System.Decimal bd2 = byteArrayConverter.ByteArrayToBigDecimal(b2, true); AssertEquals(bd1, bd2); }