public void write(float value) { int writeLen = sizeof(float); if (!writeCheck(writeLen)) { return; } BinaryUtility.memcpy(mBuffer, BinaryUtility.toBytes(value), mIndex, 0, writeLen); mIndex += writeLen; }
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; }