예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotCheckForOutOfBoundsWhenWritingSingleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustNotCheckForOutOfBoundsWhenWritingSingleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 3);
            MyRecord       record = new MyRecord(this, 0);

            record.InUse = true;
            format.Write(record, cursor, 4);
            assertFalse(cursor.CheckAndClearBoundsFlag());
        }
예제 #2
0
            protected internal override void DoReadInternal(MyRecord record, PageCursor cursor, int recordSize, long inUseByte, bool inUse)
            {
                int shortsPerRecord = ShortsPerRecord;

                for (int i = 0; i < shortsPerRecord; i++)
                {
                    short v = ( short )((cursor.Byte & 0xFF) << 8);
                    v           += ( short )(cursor.Byte & 0xFF);
                    record.Value = v;
                }
            }
예제 #3
0
            protected internal override void DoWriteInternal(MyRecord record, PageCursor cursor)
            {
                int intsPerRecord = ShortsPerRecord;

                for (int i = 0; i < intsPerRecord; i++)
                {
                    short v = record.Value;
                    sbyte a = ( sbyte )((v & 0x0000FF00) >> 8);
                    sbyte b = unchecked (( sbyte )(v & 0x000000FF));
                    cursor.PutByte(a);
                    cursor.PutByte(b);
                }
            }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustCheckForOutOfBoundsWhenWritingDoubleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustCheckForOutOfBoundsWhenWritingDoubleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 5);
            MyRecord       record = new MyRecord(this, 0);

            record.RequiresSecondaryUnit = true;
            record.SecondaryUnitId       = 42;
            record.InUse = true;
            format.ShortsPerRecordConflict.AddLast(3);                 // make the write go out of bounds
            format.Write(record, cursor, 4);
            assertTrue(cursor.CheckAndClearBoundsFlag());
        }
예제 #5
0
 protected internal override int RequiredDataLength(MyRecord record)
 {
     return(4);
 }
예제 #6
0
 protected internal override bool CanUseFixedReferences(MyRecord record, int recordSize)
 {
     return(false);
 }
예제 #7
0
 protected internal override sbyte HeaderBits(MyRecord record)
 {
     return(0);
 }