public ShortBuffer put(short[] src) { for (int i = 0; i < src.Length; ++i) { bytebuffer.putShort(src[i]); } return(this); }
public void flushEvents() { ByteBuffer buf = ByteBuffer.allocate(8); buf.order(myOrder); buf.putShort(VERSION).putShort(FLUSH_EVT).putInt(0).rewind(); writeAll(buf); buf = readResponse(FLUSH_OK); }
protected ByteBuffer preparePutData(int nChans, int nSamples, int type) { int bufsize = DataType.wordSize[type] * nSamples * nChans; ByteBuffer buf = ByteBuffer.allocate(8 + 16 + bufsize); buf.order(myOrder); buf.putShort(VERSION).putShort(PUT_DAT).putInt(16 + bufsize); buf.putInt(nChans).putInt(nSamples).putInt(type).putInt(bufsize); return(buf); }
public void flushData() { ByteBuffer buf = ByteBuffer.allocate(8); buf.order(myOrder); buf.putShort(VERSION).putShort(FLUSH_DAT).putInt(0).rewind(); lock (this) { writeAll(buf); buf = readResponse(FLUSH_OK); } }