Node buffers store data in 8-bit chunks, so endianess doesn't matter. In
the helper methods on buffers, you have to specify the endianess when
reading and writing anything over 8-bits long. (
http://nodejs.org/api/buffer.html). Here is an example using the node repl.
> b = new Buffer([1,2,3,4])
<Buffer 01 02 03 04>
> b.readUInt32LE(0)
67305985
> b.readUInt32BE(0)
16909060
Now Typed Arrays from the browser spec, which node also implements, should
be little-endian, but there is little reason to use these in node except
for cross-platform code.
On Wed, Feb 13, 2013 at 8:15 AM, divya rathode <[email protected]> wrote:
> hi friends,
> i think buffer is also similar to array,but entirely deals with
> raw memory allocations like malloc,calloc etc.,not like new and delete
> operators.but actually what the problem is i cant distinguish those
> differences clearly..
>
>
> On Monday, July 4, 2011 6:38:26 PM UTC+5:30, dennis wrote:
>>
>> hi,all
>>
>> I have a question about buffer in node.js.Is buffer big endian or little
>> endian by default?Or is it dependent on native platform?
>>
>> I think this is a big problem in networking programming,anybody knows it?
>>
>> Thanks.
>>
>> --
>> 庄晓丹
>> Email: [email protected]
>> 伯岩(花名) [email protected]
>> Blog:
>> http://www.blogjava.net/**killme2008<http://www.blogjava.net/killme2008>
>>
>> 淘宝(中国)软件有限公司 / 产品技术部 / Java中间件
>>
>> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.