(appendLength?: boolean, char?: string)
| 47 | } |
| 48 | |
| 49 | public join(appendLength?: boolean, char?: string): Buffer { |
| 50 | let length = this.getByteLength() |
| 51 | if (appendLength) { |
| 52 | this.addInt32(length + 4, true) |
| 53 | return this.join(false, char) |
| 54 | } |
| 55 | if (char) { |
| 56 | this.addChar(char, true) |
| 57 | length++ |
| 58 | } |
| 59 | const result = Buffer.alloc(length) |
| 60 | let index = 0 |
| 61 | this.buffers.forEach(function (buffer) { |
| 62 | buffer.copy(result, index, 0) |
| 63 | index += buffer.length |
| 64 | }) |
| 65 | return result |
| 66 | } |
| 67 | } |
no test coverage detected