Пример #1
0
            /// <exception cref="System.IO.IOException"/>
            public override void DoTest(BlockReaderLocal reader, byte[] original)
            {
                ByteBuffer buf = ByteBuffer.AllocateDirect(TestLength);

                ReadFully(reader, buf, 0, 5120);
                buf.Flip();
                AssertArrayRegionsEqual(original, 0, DFSTestUtil.AsArray(buf), 0, 5120);
                reader.Skip(1537);
                ReadFully(reader, buf, 0, 1);
                buf.Flip();
                AssertArrayRegionsEqual(original, 6657, DFSTestUtil.AsArray(buf), 0, 1);
                reader.ForceAnchorable();
                ReadFully(reader, buf, 0, 5120);
                buf.Flip();
                AssertArrayRegionsEqual(original, 6658, DFSTestUtil.AsArray(buf), 0, 5120);
                reader.ForceUnanchorable();
                ReadFully(reader, buf, 0, 513);
                buf.Flip();
                AssertArrayRegionsEqual(original, 11778, DFSTestUtil.AsArray(buf), 0, 513);
                reader.Skip(3);
                ReadFully(reader, buf, 0, 50);
                buf.Flip();
                AssertArrayRegionsEqual(original, 12294, DFSTestUtil.AsArray(buf), 0, 50);
            }