ByteBuffer
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -30,3 +30,2 @@ /*! | ||
var _list = []; | ||
var _offset = 0; | ||
var _endian = 'B'; | ||
@@ -212,2 +211,9 @@ | ||
}; | ||
/** | ||
* 打包成二进制,在前面加上2个字节表示包长 | ||
**/ | ||
this.packWithHead = function(){ | ||
return this.pack(true); | ||
}; | ||
@@ -214,0 +220,0 @@ /** |
{ | ||
"name": "ByteBuffer", | ||
"description": "pack or unpack a byte array", | ||
"homepage" : "http://play175.github.com/ExBuffer/", | ||
"homepage" : "http://play175.github.com/ByteBuffer/", | ||
"keywords": [ | ||
@@ -12,5 +12,5 @@ "Buffer", | ||
"author" : "yoyo <http://yoyo.play175.com>", | ||
"repository" : {"type": "git", "url": "https://github.com/play175/ExBuffer.git"}, | ||
"repository" : {"type": "git", "url": "https://github.com/play175/ByteBuffer.git"}, | ||
"main": "ByteBuffer.js", | ||
"version" : "0.2.5" | ||
"version" : "0.2.6" | ||
} |
nodejs版本的ByteBuffer和C++通信的利器! | ||
推荐结合ExBuffer来实现网络协议:https://github.com/play175/ExBuffer | ||
```javascript | ||
@@ -50,3 +52,3 @@ var ByteBuffer = require('./ByteBuffer'); | ||
//在打包的时候在开始位置插入一个short型表示包长(通信层中的包头) | ||
var buffer = sbuf.pack(true); | ||
var buffer = sbuf.packWithHead(); | ||
@@ -58,2 +60,2 @@ ``` | ||
npm install ByteBuffer -g | ||
``` | ||
``` |
@@ -47,2 +47,2 @@ var ByteBuffer = require('./ByteBuffer'); | ||
//在打包的时候在开始位置插入一个short型表示包长(通信层中的包头) | ||
var buffer = sbuf.pack(true); | ||
var buffer = sbuf.packWithHead(); |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
24165
5
317
60