Cleaner approach for writing string bytes.
This commit is contained in:
		| @@ -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 | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment