(
keyInfo: ElementInfo,
valueInfo: ElementInfo,
withOutSize = false,
)
| 95 | } |
| 96 | |
| 97 | private writeHead( |
| 98 | keyInfo: ElementInfo, |
| 99 | valueInfo: ElementInfo, |
| 100 | withOutSize = false, |
| 101 | ) { |
| 102 | // KV header |
| 103 | const header = this.getHead(keyInfo, valueInfo); |
| 104 | // chunkSize default 0 | KV header |
| 105 | this.writeContext.writer.writeUint8(header); |
| 106 | |
| 107 | if (!withOutSize) { |
| 108 | // chunkSize, max 255 |
| 109 | this.chunkOffset = this.writeContext.writer.writeGetCursor(); |
| 110 | this.writeContext.writer.writeUint8(0); |
| 111 | } else { |
| 112 | this.chunkOffset = 0; |
| 113 | } |
| 114 | return header; |
| 115 | } |
| 116 | |
| 117 | public isFirst() { |
| 118 | return this.chunkSize === 0 || this.chunkSize === 1; |
no test coverage detected