作者TonyQ (骨头)
看板java
标题Re: [分享] byte[]计算
时间Sun Mar 25 20:40:20 2007
※ 引述《qrtt1 (愚人)》之铭言:
: ※ 引述《TonyQ (骨头)》之铭言:
: : }
: endian problem
: http://tinyurl.com/2cvxym
搞懂了
原来是存档是 byte从低阶存到高阶 (little-endian)
还有从高阶存到低阶 (big-endian) 两者在读档上不同所造成的问题。
Java预设是big-endian,我读的档案刚好是little-endian,orzorz
我找到一个参考用的InputStream (它继承DataInputStream 做扩充)
http://www.cs.cornell.edu/courses/cs212/2001fa/
Project/Part1/le/LEDataInputStream.java.
总算解决这个问题了。(泪)
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the compiler will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.practice()); | Bone
everything
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.134.27.68