예제 #1
0
        public virtual void TestShort()
        {
            short s = 4598;

            byte[] b2 = byteArrayConverter.ShortToByteArray(s);
            short  s2 = byteArrayConverter.ByteArrayToShort(b2);

            // assertEquals(s,s2);
            s  = 10000;
            b2 = byteArrayConverter.ShortToByteArray(s);
            s2 = byteArrayConverter.ByteArrayToShort(b2);
            AssertEquals(s, s2);
            s  = short.MaxValue;
            b2 = byteArrayConverter.ShortToByteArray(s);
            s2 = byteArrayConverter.ByteArrayToShort(b2);
            AssertEquals(s, s2);
            s  = short.MinValue;
            b2 = byteArrayConverter.ShortToByteArray(s);
            s2 = byteArrayConverter.ByteArrayToShort(b2);
            AssertEquals(s, s2);
        }
예제 #2
0
        public virtual short ReadShort(string label)
        {
            long  position = io.GetCurrentPosition();
            short s        = byteArrayConverter.ByteArrayToShort(ReadShortBytes());

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