mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +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
|
* @param bytes the byte array to write
|
||||||
*/
|
*/
|
||||||
public void writeBytes(byte @NotNull [] bytes) {
|
public void writeBytes(byte @NotNull [] bytes) {
|
||||||
|
if (bytes.length == 0) return;
|
||||||
ensureSize(bytes.length);
|
ensureSize(bytes.length);
|
||||||
buffer.put(bytes);
|
buffer.put(bytes);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user