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; }
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; }
public FixData(int startip, int size, int newsize, ShortBuffer code, bool beforeinsertion ) { StartIP = startip; Size = size; NewSize = newsize; Code = code; BeforeInsertion = beforeinsertion; }
public static ShortBuffer Wrap(short[] data) { ShortBuffer buf = new ShortBuffer(new byte[data.Length * 2], 0, data.Length * 2); buf.Put(data); return buf; }