Silphire (7255) の日記

2003 年 03 月 01 日
午後 10:42

ゆで卵を両端から食べる

今日は、zlibが生成するファイルのフォーマットを調べていました。zlibのファイルフォーマットは、以下に示すRFCにその仕様の全容が書かれています。

この中にはおもしろい記述があります。RFC1950の方では、エンディアンについて以下のような記述があります。

Within a computer, a number may occupy multiple bytes. All multi-byte numbers in the format described here are stored with the MOST-significant byte first (at the lower memory address). (RFC1950 p.3)

一方、RFC1951では、エンディアンについての記述は以下のようになっています。

Within a computer, a number may occupy multiple bytes. All multi-byte numbers in the format described here are stored with the least-significant byte first (at the lower memory address). (RFC1951 p.4)

1つのファイルフォーマットの中に、リトル・エンディアンとビッグ・エンディアンが混在するというおもしろい事に。

…この為に何時間を費やした事か。文章が酷似しているので、全く気付きませんでした。先人の苦労に感謝です。

この議論は賞味期限が切れたので、アーカイブ化されています。 新たにコメントを付けることはできません。

Stay hungry, Stay foolish. -- Steven Paul Jobs

処理中...