mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Fast exit when trying to write an empty array
This commit is contained in:
parent
62916239b5
commit
72bda2c4ec
@ -235,6 +235,7 @@ public class BinaryWriter extends OutputStream {
|
||||
* @param bytes the byte array to write
|
||||
*/
|
||||
public void writeBytes(byte @NotNull [] bytes) {
|
||||
if (bytes.length == 0) return;
|
||||
ensureSize(bytes.length);
|
||||
buffer.put(bytes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user