- Node.js 教程
- Node.js - 首頁
- Node.js - 簡介
- Node.js - 環境搭建
- Node.js - 第一個應用
- Node.js - REPL 終端
- Node.js - 命令列選項
- Node.js - 包管理器 (NPM)
- Node.js - 回撥函式概念
- Node.js - 上傳檔案
- Node.js - 傳送郵件
- Node.js - 事件
- Node.js - 事件迴圈
- Node.js - 事件發射器
- Node.js - 偵錯程式
- Node.js - 全域性物件
- Node.js - 控制檯
- Node.js - 程序
- Node.js - 應用程式擴充套件
- Node.js - 打包
- Node.js - Express 框架
- Node.js - RESTFul API
- Node.js - 緩衝區
- Node.js - 流
- Node.js - 檔案系統
- Node.js MySQL
- Node.js - MySQL 入門
- Node.js - MySQL 建立資料庫
- Node.js - MySQL 建立表
- Node.js - MySQL 插入資料
- Node.js - MySQL 從表中選擇資料
- Node.js - MySQL 條件查詢
- Node.js - MySQL 排序
- Node.js - MySQL 刪除資料
- Node.js - MySQL 更新資料
- Node.js - MySQL 連線查詢
- Node.js MongoDB
- Node.js - MongoDB 入門
- Node.js - MongoDB 建立資料庫
- Node.js - MongoDB 建立集合
- Node.js - MongoDB 插入資料
- Node.js - MongoDB 查詢資料
- Node.js - MongoDB 查詢
- Node.js - MongoDB 排序
- Node.js - MongoDB 刪除資料
- Node.js - MongoDB 更新資料
- Node.js - MongoDB 限制結果
- Node.js - MongoDB 連線查詢
- Node.js 模組
- Node.js - 模組
- Node.js - 內建模組
- Node.js - 實用程式模組
- Node.js - Web 模組
- Node.js 有用資源
- Node.js - 快速指南
- Node.js - 有用資源
- Node.js - 討論
NodeJS v8.serializer.releaseBuffer() 方法
NodeJS v8.serializer.releaseBuffer() 方法是 v8.serializer 類的一個方法,用於檢索儲存在內部緩衝區中的值。
建議在釋放緩衝區後不要再次使用序列化器。
如果之前的寫入操作失敗,此方法將返回 undefined。
語法
v8.serializer.releaseBuffer()
引數
此方法不接受任何引數。
返回值
此方法返回儲存的內部緩衝區。
示例
在本例中,我們嘗試使用 NodeJS v8.serializer.releaseBuffer() 方法獲取儲存的內部緩衝區。
// Importing the v8 module
const v8 = require('v8');
// Creating a new object for the v8 serializer
const serializer = new v8.Serializer();
// Printing buffer value if any
console.log(serializer.releaseBuffer());
輸出
從下面的輸出中可以看出,v8.serializer.releaseBuffer() 方法返回了內部緩衝區。
<Buffer >
示例
在下面的示例中,首先,我們嘗試使用 releaseBuffer() 方法檢索內部緩衝區,然後我們使用 writeHeader() 方法將標題值寫入內部緩衝區。最後,我們檢索包含標題值的內部緩衝區。
// Importing the v8 module
const v8 = require('v8');
// Creating a new object for the v8 serializer
const serializer = new v8.Serializer();
// Printing buffer value if any
console.log(serializer.releaseBuffer());
// Writing headers to the internal buffer
console.log(serializer.writeHeader());
// Printing the buffer value after writing header
console.log(serializer.releaseBuffer());
輸出
<Buffer > undefined <Buffer ff 0d>
nodejs_v8_module.htm
廣告
