Наследование: global::java.nio.Buffer, global::java.lang.Comparable
Пример #1
0
        private void sss()
        {
            int        size = 13 * 1024;//*1024
            ByteBuffer bb   = a(size);

            bb.capacity();
            JNIEnv.DetachCurrentThread();
        }
Пример #2
0
        private ByteBuffer a(int size)
        {
            var sharedBuffer = new byte[size];
            var buffer       = new DirectByteBuffer(sharedBuffer);

            buffer.position(size - 1);
            buffer.put(0xEE);
            ByteBuffer byteBuffer = Bridge.Cast <ByteBuffer>(buffer);

            return(byteBuffer);
        }
Пример #3
0
        public void BB()
        {
            byte[] myLovelyData = PrepareData();

            GCHandle   pin    = GCHandle.Alloc(myLovelyData, GCHandleType.Pinned);
            IntPtr     ptr    = Marshal.UnsafeAddrOfPinnedArrayElement(myLovelyData, 0);
            ByteBuffer buffer = JNIEnv.ThreadEnv.NewDirectByteBuffer(ptr, 2048);

            buffer.order(ByteOrder.LITTLE_ENDIAN);

            Assert.AreEqual(0x00, buffer.get());
            Assert.AreEqual(0x01, buffer.get());
            buffer.position(0xfe);
            Assert.AreEqual(0xfe, buffer.get());
            Assert.AreEqual(0xff, buffer.get());
            buffer.position(0x1CC);
            Assert.AreEqual('Ž', buffer.getChar());
            buffer.position(0x1aa);
            Assert.AreEqual(0.112233d, buffer.getDouble());
        }
Пример #4
0
        public NITFSImageSegment(java.nio.ByteBuffer buffer, int headerStartOffset, int headerLength, int dataStartOffset, int dataLength)
        {
            base(NITFSSegmentType.IMAGE_SEGMENT, buffer, headerStartOffset, headerLength, dataStartOffset, dataLength);

            int saveOffset = buffer.position();

            buffer.position(headerStartOffset);
            // do not change order of parsing
            this.parseIdentificationSecurityStructureFields(buffer);
            this.parseImageGeographicLocation(buffer);
            this.parseCommentRecords(buffer);
            this.parseImageCompressionStructure(buffer);
            this.parseImageBands(buffer);
            this.parseImageTableStructure(buffer);
            this.parseImageLocation(buffer);
            this.parseImageSubheaders(buffer);
            this.parseImageData(buffer);
            this.validateImage();

            buffer.position(saveOffset); // last line - restore buffer's position
        }
Пример #5
0
 internal JavaCV\u00241([In] int obj0, [In] int obj1, [In] int obj2, [In] int obj3, [In] DoubleBuffer obj4, [In] int obj5, [In] DoubleBuffer obj6, [In] int obj7, [In] double obj8, [In] int obj9, [In] ByteBuffer obj10, [In] int obj11, [In] bool obj12, [In] double obj13, [In] ByteBuffer obj14, [In] int obj15)
 {
   int num = obj12 ? 1 : 0;
   this.val\u0024w = obj0;
   this.val\u0024maxwindow = obj1;
   this.val\u0024minwindow = obj2;
   this.val\u0024h = obj3;
   this.val\u0024sumbuf = obj4;
   this.val\u0024sumstep = obj5;
   this.val\u0024sqsumbuf = obj6;
   this.val\u0024sqsumstep = obj7;
   this.val\u0024targetvar = obj8;
   this.val\u0024srcdepth = obj9;
   this.val\u0024srcbuf = obj10;
   this.val\u0024srcstep = obj11;
   this.val\u0024invert = num != 0;
   this.val\u0024k = obj13;
   this.val\u0024dstbuf = obj14;
   this.val\u0024dststep = obj15;
   base.\u002Ector();
 }
Пример #6
0
    public static java.lang.Class defineClass2(java.lang.ClassLoader thisClassLoader, string name, java.nio.ByteBuffer bb, int off, int len, java.security.ProtectionDomain pd, string source)
    {
#if FIRST_PASS
        return(null);
#else
        byte[] buf = new byte[bb.remaining()];
        bb.get(buf);
        return(defineClass1(thisClassLoader, name, buf, 0, buf.Length, pd, source));
#endif
    }
Пример #7
0
 /// <summary>
 /// Relative bulk <i>put</i> method  <i>(optional operation)</i>.
 /// </summary>
 public ByteBuffer put(ByteBuffer src)
 {
     return default(ByteBuffer);
 }