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I,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE;YAC1C,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACxB,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAAE,OAAO;aAAE;SACjE;QACD,UAAU,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;AACL,CAAC","file":"writer.js","sourcesContent":["// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { DataType } from '../../type';\nimport { RecordBatch } from '../../recordbatch';\nimport { AsyncByteStream } from '../../io/stream';\nimport { RecordBatchWriter } from '../../ipc/writer';\n\n/** @ignore */\nexport function recordBatchWriterThroughDOMStream<T extends { [key: string]: DataType } = any>(\n this: typeof RecordBatchWriter,\n writableStrategy?: QueuingStrategy<RecordBatch<T>> & { autoDestroy: boolean },\n readableStrategy?: { highWaterMark?: number, size?: any }\n) {\n\n const writer = new this<T>(writableStrategy);\n const reader = new AsyncByteStream(writer);\n const readable = new ReadableStream({\n type: 'bytes',\n async cancel() { await reader.cancel(); },\n async pull(controller) { await next(controller); },\n async start(controller) { await next(controller); },\n }, { 'highWaterMark': 2 ** 14, ...readableStrategy });\n\n return { writable: new WritableStream(writer, writableStrategy), readable };\n\n async function next(controller: ReadableStreamDefaultController<Uint8Array>) {\n let buf: Uint8Array | null = null;\n let size = controller.desiredSize;\n while (buf = await reader.read(size || null)) {\n controller.enqueue(buf);\n if (size != null && (size -= buf.byteLength) <= 0) { return; }\n }\n controller.close();\n }\n}\n"]} |