Fix the size of ByteBuffer
Fix Atmosphere/atmosphere#1720

Change-Id: I79816520d7b4fd25307fe9516703f621ca109104