Inheritance: ByteBuffer
Example #1
0
 public static IntBuffer Wrap(int[] data)
 {
     IntBuffer buf = new IntBuffer(new byte[data.Length * 4], 0, data.Length * 4);
     for (int i = 0; i < data.Length; i++)
     {
         buf.PutInt(data[i]);
     }
     return buf;
 }
Example #2
0
        public IntBuffer AsIntBuffer()
        {
            IntBuffer buf = new IntBuffer();
            buf.buffer = new byte[this.buffer.Length];
            this.buffer.CopyTo(buf.buffer, 0);

            buf.c = this.c;
            buf.capacity = this.capacity;
            buf.index = this.index;
            buf.limit = this.limit;
            buf.mark = this.mark;
            buf.offset = this.offset;
            buf.order = this.order;
            return buf;
        }