We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2de410b commit 28db260Copy full SHA for 28db260
src/bencode/BencodeEncoder.ts
@@ -113,7 +113,7 @@ export class BencodeEncoder implements BinaryJsonEncoder {
113
const length = utf8Size(str);
114
writer.ascii(length + '');
115
writer.u8(0x3a); // ':'
116
- writer.ensureCapacity(length);
+ writer.ensureCapacity(str.length * 4);
117
writer.utf8(str);
118
}
119
src/ion/IonEncoderFast.ts
@@ -182,6 +182,7 @@ export class IonEncoderFast {
182
writer.u8(TYPE_OVERLAY.STRI + 14);
183
this.writeVUint(length);
184
185
+ writer.ensureCapacity(length * 4);
186
187
188
0 commit comments