Skip to content

feat: read & write to files using js buffers#10093

Merged
NathanWalker merged 5 commits into
mainfrom
feat/rw-buffers
Mar 17, 2023
Merged

feat: read & write to files using js buffers#10093
NathanWalker merged 5 commits into
mainfrom
feat/rw-buffers

Conversation

@triniwiz
Copy link
Copy Markdown
Member

@triniwiz triniwiz commented Nov 15, 2022

The current read/write on Android use a Java array so trying to use it with something like ArrayBuffer or any of the typed arrays could be slower due to the amount of copying of data.

This adds new optional methods for developers to use when needing fast read/write with large data:

readBuffer(path: string, onError?: (error: any) => any): ArrayBuffer;

readBufferAsync(path: string): Promise<ArrayBuffer>;

readBufferSync(path: string, onError?: (error: any) => any): ArrayBuffer;

writeBuffer(path: string, content: ArrayBuffer | Uint8Array | Uint8ClampedArray, onError?: (error: any) => any);

writeBufferAsync(path: string, content: ArrayBuffer | Uint8Array | Uint8ClampedArray): Promise<void>;

writeBufferSync(path: string, content: ArrayBuffer | Uint8Array | Uint8ClampedArray, onError?: (error: any) => any);

@cla-bot cla-bot Bot added the cla: yes label Nov 15, 2022
@NathanWalker NathanWalker added this to the 8.5 milestone Jan 16, 2023
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 16, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1301e96. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@NathanWalker NathanWalker marked this pull request as ready for review March 16, 2023 15:35
NathanWalker
NathanWalker previously approved these changes Mar 16, 2023
@NathanWalker NathanWalker merged commit 0173769 into main Mar 17, 2023
@NathanWalker NathanWalker deleted the feat/rw-buffers branch March 17, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants