Refactor packet string charset

This commit is contained in:
P0nk
2021-06-21 22:03:20 +02:00
parent c4c5700d32
commit 72ff8d563b
4 changed files with 9 additions and 12 deletions

View File

@@ -6,7 +6,6 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.awt.*;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -82,7 +81,7 @@ class ByteBufInPacketTest {
void readString() {
final String writtenString = "You have gained experience (+3200)";
byteBuf.writeShortLE(writtenString.length());
byte[] writtenStringBytes = writtenString.getBytes(StandardCharsets.US_ASCII);
byte[] writtenStringBytes = writtenString.getBytes(Packet.STRING_CHARSET);
byteBuf.writeBytes(writtenStringBytes);
String readString = inPacket.readString();