Closed Bug 1551962 Opened 5 months ago Closed 5 months ago

We don't have a sane way to create a stream from nsTArray<uint8_t>&&

Categories

(Core :: XPCOM, task)

task
Not set

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

We have string input streams, but we don't seem to have a way to create an input stream from an nsTArray of bytes without copying it into a string, or copying into a pipe, or some form of copying.

We have NS_NewByteInputStream but that requires a malloced buffer or for the original data to stay alive.

Maybe we could change nsStringInputStream to have a nsTArray<uint8_t> inside and allow move-constructing that and then depending on its bytes?

Assignee: nobody → bzbarsky
Type: defect → task
Attachment #9065142 - Attachment description: Bug 1551962. Add a way to create an input stream from a moved nsTArray<uint32_t>. r=froydnj → Bug 1551962. Add a way to create an input stream from a moved nsTArray<uint8_t>. r=froydnj
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3300402f4239
Add a way to create an input stream from a moved nsTArray<uint8_t>.  r=froydnj
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.