Package tools.data
package tools.data
位元組層資料存取:封包 payload 的小端序(little-endian)讀寫基礎。
本 package 是整個封包編解碼的最底層原語。ByteArrayByteStream 將一個
byte[] 抽象為可循序讀取/定位(seek/getPosition/available)的
位元組串流;LittleEndianAccessor 包覆其上,提供小端序的型別化讀取
(readByte/readShort/readInt/readLong/readFloat/
readDouble),以及 MapleStory 慣例的字串與座標讀取(readMapleAsciiString/
readPos);MaplePacketLittleEndianWriter 則為對應的寫入器,將各型別以小端序
累寫進內部緩衝(writeShort/writeInt/writeLong/writeMapleAsciiString/
writePos/writeRect),最終以 getPacket() 取出組好的 byte[]。
字串一律以硬編碼的 Big5 字集進行 byte↔char 轉換(對應台版客戶端的線路編碼),
不依賴 JVM 預設字集,是相對於 Encoding.DEFAULT 之外、刻意獨立的線路字集約定。
入站封包經 MaplePacketDecoder 解密後交由 LittleEndianAccessor 解析;
出站封包則由 tools.packet.* 系列建構器透過 MaplePacketLittleEndianWriter 組裝。
-
ClassesClassDescriptionProvides for an abstraction layer for an array of bytes.Provides a interface to a Little Endian stream of bytes.Round-trip unit tests for the packet little-endian layer.Writes a maplestory-packet little-endian stream of bytes.