putShort() public method

public putShort ( short src ) : ByteBuffer
src short
return ByteBuffer
コード例 #1
0
 public ShortBuffer put(short[] src)
 {
     for (int i = 0; i < src.Length; ++i)
     {
         bytebuffer.putShort(src[i]);
     }
     return(this);
 }
コード例 #2
0
ファイル: BufferClient.cs プロジェクト: abzaloid/buffer-bci
        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);
        }
コード例 #3
0
ファイル: BufferClient.cs プロジェクト: abzaloid/buffer-bci
        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);
        }
コード例 #4
0
        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);
            }
        }