public virtual void TestBoolean() { bool b1 = true; byte[] b2 = byteArrayConverter.BooleanToByteArray(b1); bool b3 = byteArrayConverter.ByteArrayToBoolean(b2, 0); AssertEquals(b1, b3); b1 = false; b2 = byteArrayConverter.BooleanToByteArray(b1); b3 = byteArrayConverter.ByteArrayToBoolean(b2, 0); AssertEquals(b1, b3); }
public virtual void WriteBoolean(bool b, bool writeInTransaction, string label) { if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId) && canLog && label != null) { NeoDatis.Tool.DLogger.Debug("writing boolean " + b + " at " + GetPosition() + " : " + label); } byte[] bytes = byteArrayConverter.BooleanToByteArray(b); if (!writeInTransaction) { io.WriteBytes(bytes); } else { GetSession().GetTransaction().ManageWriteAction(io.GetCurrentPosition(), bytes); EnsureSpaceFor(NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.NativeBoolean); } bytes = null; }