Exemplo n.º 1
0
    public void write(float value)
    {
        int writeLen = sizeof(float);

        if (!writeCheck(writeLen))
        {
            return;
        }
        BinaryUtility.memcpy(mBuffer, BinaryUtility.toBytes(value), mIndex, 0, writeLen);
        mIndex += writeLen;
    }
Exemplo n.º 2
0
    public void read(ref short value)
    {
        int readLen = sizeof(short);

        if (!readCheck(readLen))
        {
            return;
        }
        byte[] dest = BinaryUtility.toBytes(value);
        BinaryUtility.memcpy(dest, mBuffer, 0, mIndex, readLen);
        value   = BinaryUtility.bytesToShort(dest);
        mIndex += readLen;
    }