温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/v8/DefaultSerializer
点击访问原文链接

Node v8.DefaultSerializer class | API Reference | Bun

Node v8.DefaultSerializer class | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:v8/DefaultSerializerCoconstructorMreleaseBufferMtransferArrayBufferMwriteDoubleMwriteHeaderMwriteRawBytesMwriteUint32MwriteUint64MwriteValue

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:v8/DefaultSerializerCoconstructorMreleaseBufferMtransferArrayBufferMwriteDoubleMwriteHeaderMwriteRawBytesMwriteUint32MwriteUint64MwriteValue

class

v8.DefaultSerializerclass DefaultSerializer

A subclass of Serializer that serializes TypedArray(in particular Buffer) and DataView objects as host objects, and only stores the part of their underlying ArrayBuffers that they are referring to.

releaseBuffer(): NonSharedBuffer;

Returns the stored internal buffer. This serializer should not be used once the buffer is released. Calling this method results in undefined behavior if a previous write has failed.

transferArrayBuffer(id: number,arrayBuffer: ArrayBuffer): void;

Marks an ArrayBuffer as having its contents transferred out of band. Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().

@param id

A 32-bit unsigned integer.

@param arrayBuffer

An ArrayBuffer instance.

writeDouble(value: number): void;

Write a JS number value. For use inside of a custom serializer._writeHostObject().

writeHeader(): void;

Writes out a header, which includes the serialization format version.

writeRawBytes(buffer: ArrayBufferView): void;

Write raw bytes into the serializer's internal buffer. The deserializer will require a way to compute the length of the buffer. For use inside of a custom serializer._writeHostObject().

writeUint32(value: number): void;

Write a raw 32-bit unsigned integer. For use inside of a custom serializer._writeHostObject().

writeUint64(hi: number,lo: number): void;

Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. For use inside of a custom serializer._writeHostObject().

writeValue(val: any): boolean;

Serializes a JavaScript value and adds the serialized representation to the internal buffer.

This throws an error if value cannot be serialized.

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node v8.DefaultSerializer class | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only stores the part of their underlying `ArrayBuffer`s that they are referring to.