Cleaner approach for writing string bytes.
This commit is contained in:
parent
d9ce0943ae
commit
1d2e773cbd
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
|||||||
{
|
{
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
writeShort(0);
|
writeShort(0);
|
||||||
}
|
}
|
||||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
|||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
writeShort(text.length());
|
writeShort(text.length());
|
||||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||||
for (int i = 0; i < bytes.length; i++)
|
|
||||||
{
|
|
||||||
writeByte(bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user