HCOLL-256 Fixed a bug in CharArrayMarshaller and made some other marshallers more robust

This commit is contained in:
leventov
2014-12-16 20:41:46 +07:00
parent c7b7af8e2b
commit d196d01fda
5 changed files with 42 additions and 24 deletions
@@ -31,6 +31,8 @@ enum LongPairArrayReader implements BytesReader<LongPair[]> {
@Override
public LongPair[] read(Bytes bytes, long size, LongPair[] toReuse) {
if (size > Integer.MAX_VALUE * 16L)
throw new IllegalStateException("LongPair[] size couldn't be " + (size / 16L));
int resLen = (int) (size / 16L);
LongPair[] res;
if (toReuse != null) {