示例#1
0
        public virtual void TestLong()
        {
            long l1 = 785412;

            byte[] b  = byteArrayConverter.LongToByteArray(l1);
            long   l2 = byteArrayConverter.ByteArrayToLong(b, 0);

            AssertEquals(l1, l2);
            l1 = long.MaxValue;
            b  = byteArrayConverter.LongToByteArray(l1);
            l2 = byteArrayConverter.ByteArrayToLong(b, 0);
            AssertEquals(l1, l2);
            l1 = long.MinValue;
            b  = byteArrayConverter.LongToByteArray(l1);
            l2 = byteArrayConverter.ByteArrayToLong(b, 0);
            AssertEquals(l1, l2);
        }
示例#2
0
        public virtual long ReadLong(string label)
        {
            long position = io.GetCurrentPosition();
            long l        = byteArrayConverter.ByteArrayToLong(ReadLongBytes(), 0);

            if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId) && canLog)
            {
                NeoDatis.Tool.DLogger.Debug("reading long " + l + " at " + position + (label != null
                                         ? " : " + label : string.Empty));
            }
            return(l);
        }