mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 10:20:42 +01:00
Fix writer to array conversion
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
fbf6479135
commit
9f1efb0932
@ -317,6 +317,7 @@ public class BinaryWriter extends OutputStream {
|
|||||||
* @return the byte array containing all the {@link BinaryWriter} data
|
* @return the byte array containing all the {@link BinaryWriter} data
|
||||||
*/
|
*/
|
||||||
public byte[] toByteArray() {
|
public byte[] toByteArray() {
|
||||||
|
buffer.flip();
|
||||||
byte[] bytes = new byte[buffer.remaining()];
|
byte[] bytes = new byte[buffer.remaining()];
|
||||||
buffer.get(bytes);
|
buffer.get(bytes);
|
||||||
return bytes;
|
return bytes;
|
||||||
|
Loading…
Reference in New Issue
Block a user