* Writes a buffer according to Cassandra protocol: bytes.length (2) + bytes * @param {Buffer} bytes
(bytes)
| 86 | * @param {Buffer} bytes |
| 87 | */ |
| 88 | writeShortBytes(bytes) { |
| 89 | if(bytes === null) { |
| 90 | //Only the length buffer containing -1 |
| 91 | this.writeShort(-1); |
| 92 | return; |
| 93 | } |
| 94 | //Add the length buffer |
| 95 | this.writeShort(bytes.length); |
| 96 | //Add the actual buffer |
| 97 | this.add(bytes); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Writes a single byte |
no test coverage detected