Class MaplePacketLittleEndianWriter
java.lang.Object
tools.data.MaplePacketLittleEndianWriter
Writes a maplestory-packet little-endian stream of bytes.
- Since:
- Revision 352
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor - initializes this stream with a default size.MaplePacketLittleEndianWriter(int size) Constructor - initializes this stream with sizesize. -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]Gets aMaplePacketinstance representing this sequence of bytes.final StringtoString()Changes this packet into a human-readable hexadecimal stream of bytes.final voidwrite(byte b) Write a byte to the stream.final voidwrite(byte[] b) Write an array of bytes to the stream.final voidwrite(int b) final voidWrites an ASCII string the the stream.final voidwriteAsciiString(String s, int max) final voidwriteInt(int i) Writes an integer to the stream.final voidwriteLong(long l) Write a long integer to the stream.final voidWrites a maple-convention ASCII string to the stream.final voidWrites a 2D 4 byte position informationfinal voidfinal voidwriteReversedLong(long l) final voidwriteShort(int i) Write a short integer to the stream.final voidwriteZeroBytes(int i) Write the number of zero bytes
-
Constructor Details
-
MaplePacketLittleEndianWriter
public MaplePacketLittleEndianWriter()Constructor - initializes this stream with a default size. -
MaplePacketLittleEndianWriter
public MaplePacketLittleEndianWriter(int size) Constructor - initializes this stream with sizesize.- Parameters:
size- The size of the underlying stream.
-
-
Method Details
-
getPacket
public final byte[] getPacket()Gets aMaplePacketinstance representing this sequence of bytes.- Returns:
- A
MaplePacketwith the bytes in this stream.
-
toString
-
writeZeroBytes
public final void writeZeroBytes(int i) Write the number of zero bytes- Parameters:
i- the number of zero bytes to write.
-
write
public final void write(byte[] b) Write an array of bytes to the stream.- Parameters:
b- The bytes to write.
-
write
public final void write(byte b) Write a byte to the stream.- Parameters:
b- The byte to write.
-
write
public final void write(int b) -
writeShort
public final void writeShort(int i) Write a short integer to the stream.- Parameters:
i- The short integer to write.
-
writeInt
public final void writeInt(int i) Writes an integer to the stream.- Parameters:
i- The integer to write.
-
writeAsciiString
Writes an ASCII string the the stream.- Parameters:
s- The ASCII string to write.
-
writeAsciiString
-
writeMapleAsciiString
Writes a maple-convention ASCII string to the stream.- Parameters:
s- The ASCII string to use maple-convention to write.
-
writePos
Writes a 2D 4 byte position information- Parameters:
s- The Point position to write.
-
writeRect
-
writeLong
public final void writeLong(long l) Write a long integer to the stream.- Parameters:
l- The long integer to write.
-
writeReversedLong
public final void writeReversedLong(long l)
-