EsotericSoftware / EsotericSoftware/kryonet

服务端读取object时报Unable to read object larger than read buffer

Open
#144 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
411
PR merge metrics
No merged PRs in 30d

Description

默认的buffer2048 ,读取的时候报Unable to read object larger than read buffer异常,
![qq 20180413204456](https://user-images.githubusercontent.com/8073442/38735533-9c521874-3f5b-11e8-9917-93c86da5b5f2.jpg)
当我把buffersize 扩大时,读取的结果为null,
![qq 20180413205224](https://user-images.githubusercontent.com/8073442/38735831-a3af090a-3f5c-11e8-8f51-f36a91864548.jpg)
不管怎么样都会走到这里
if (currentObjectLength <= 0) throw new KryoNetException("Invalid object length: " + currentObjectLength);
if (currentObjectLength > readBuffer.capacity())
throw new KryoNetException("Unable to read object larger than read buffer: " + currentObjectLength);
大家有遇到吗?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.