This commit is contained in:
Anuken
2021-06-25 19:35:34 -04:00
parent 47443d5ae7
commit eaeb67b91f
4 changed files with 14 additions and 9 deletions

View File

@@ -391,7 +391,15 @@ public class ArcNetProvider implements NetProvider{
//no compression, copy over buffer
if(compression == 0){
buffer.position(0).limit(length);
buffer.put(byteBuffer.array(), byteBuffer.position(), length);
if(byteBuffer.hasArray()){
buffer.put(byteBuffer.array(), byteBuffer.position(), length);
}else{
byte[] readcopy = new byte[length];
int pos = byteBuffer.position();
byteBuffer.get(readcopy);
byteBuffer.position(pos);
buffer.put(readcopy);
}
buffer.position(0);
packet.read(reads.get(), length);
//move read packets forward