summaryrefslogtreecommitdiff
path: root/textproto/mod.ts
diff options
context:
space:
mode:
Diffstat (limited to 'textproto/mod.ts')
-rw-r--r--textproto/mod.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/textproto/mod.ts b/textproto/mod.ts
index ee7647296..28eac4609 100644
--- a/textproto/mod.ts
+++ b/textproto/mod.ts
@@ -22,6 +22,17 @@ export class ProtocolError extends Error {
}
}
+export function append(a: Uint8Array, b: Uint8Array): Uint8Array {
+ if (a == null) {
+ return b;
+ } else {
+ const output = new Uint8Array(a.length + b.length);
+ output.set(a, 0);
+ output.set(b, a.length);
+ return output;
+ }
+}
+
export class TextProtoReader {
constructor(readonly r: BufReader) {}
@@ -137,14 +148,3 @@ export class TextProtoReader {
return [line, null];
}
}
-
-export function append(a: Uint8Array, b: Uint8Array): Uint8Array {
- if (a == null) {
- return b;
- } else {
- const output = new Uint8Array(a.length + b.length);
- output.set(a, 0);
- output.set(b, a.length);
- return output;
- }
-}