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)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,11 +70,7 @@ public abstract class WritablePacket
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
writeShort(0);
|
||||
}
|
||||
@ -88,11 +84,7 @@ public abstract class WritablePacket
|
||||
if (text != null)
|
||||
{
|
||||
writeShort(text.length());
|
||||
final byte[] bytes = text.getBytes(StandardCharsets.UTF_16LE);
|
||||
for (int i = 0; i < bytes.length; i++)
|
||||
{
|
||||
writeByte(bytes[i]);
|
||||
}
|
||||
writeBytes(text.getBytes(StandardCharsets.UTF_16LE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user