it's just a byte value, which when i print it out, it is shown as a signed number.
from observation, anything negative appears to transform into two bytes, which are also negative. -108 (0x94) -> -62 -108 (0xc294), -2 (0xfe) -> -61 -66 (0xc3be). On Wednesday, April 23, 2014 11:23:23 AM UTC-7, Aria Stewart wrote: > > > On Apr 22, 02014, at 20:29, Mike Kobyakov <[email protected] <javascript:>> > wrote: > > i have two services (one in node, one in java) sharing objects, which are > compressed and, therefore, binary. > > nodejs does a str.toString('binary') on the compressed buffer. this > changes the buffer as in the following example. > > enc [ -108 1 72 116 104 105 115 32 105 115 32 116 104 101 32 115 116 > 114 105 110 103 32 70 19 0 70 18 0 -2 37 0 114 37 0 ] > > enc.toString('binary') [ -62 -108 1 72 116 104 105 115 32 105 115 32 116 > 104 101 32 115 116 114 105 110 103 32 70 19 0 70 18 0 -61 -66 37 0 114 37 0 > ] > > unfortunately, it appears that negative bytes become two negative bytes in > 'binary' encoding, and i cannot find a java charset that can translate the > latter into the former. > > > Wait, “Negative bytes”?! > > That’s not a thing node does. Where is this object coming from and what > kind is it? > > -- -- 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/d/optout.
