Inheritance: ByteBuffer
示例#1
0
 public virtual void Copy(InterCodeGenerator.FixData fixdata)
 {
     Code = null;
     StartIP = fixdata.StartIP;
     Size = fixdata.Size;
     NewSize = fixdata.NewSize;
     BeforeInsertion = fixdata.BeforeInsertion;
     short[] newbuff = new short[NewSize];
     //ByteBuffer buff = ByteBuffer.allocate(NewSize*2);
     //buff.order( ByteOrder.nativeOrder() );
     //ShortBuffer ibuff = buff.asShortBuffer();
     ShortBuffer ibuff = ShortBuffer.Wrap(newbuff);
     ibuff.Clear();
     ByteBuffer tmp = fixdata.Code.Duplicate();
     tmp.Flip();
     ibuff.Put(tmp);
     Code = ibuff;
 }
示例#2
0
        public ShortBuffer AsShortBuffer()
        {
            ShortBuffer buf = new ShortBuffer();
            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;
        }
示例#3
0
 public FixData(int startip, int size, int newsize, ShortBuffer code, bool beforeinsertion
     )
 {
     StartIP = startip;
     Size = size;
     NewSize = newsize;
     Code = code;
     BeforeInsertion = beforeinsertion;
 }
示例#4
0
 public static ShortBuffer Wrap(short[] data)
 {
     ShortBuffer buf = new ShortBuffer(new byte[data.Length * 2], 0, data.Length * 2);
     buf.Put(data);
     return buf;
 }