Re: [分享] byte[]計算
※ 引述《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
討論串 (同標題文章)