Fixed BufferUnderflowException

Fixed the exception occurring when using this serializer. More commented here:

http://hub.jmonkeyengine.org/t/savableserializer-and-client-bufferunderflowexception/31774
This commit is contained in:
NemesisMate 2015-02-26 14:41:29 +01:00
parent ee151af5d2
commit 2aa6f9f521

View File

@ -93,7 +93,7 @@ public class SavableSerializer extends Serializer {
@Override
public int read(byte[] b, int off, int len){
int toRead = len > input.remaining() ? input.remaining() : len;
input.get(b, off, len);
input.get(b, off, toRead);
return toRead;
}