add Buffer capacity check for type UInt64 (#454)

This commit is contained in:
OlivierSalasc
2018-09-27 14:49:25 +02:00
committed by Jeroen van Erp
parent 4de9f8ab9f
commit 17c368f9c2
2 changed files with 25 additions and 0 deletions

View File

@@ -372,6 +372,7 @@ public class Buffer<T extends Buffer<T>> {
@SuppressWarnings("unchecked")
private T putUInt64Unchecked(long uint64) {
ensureCapacity(8);
data[wpos++] = (byte) (uint64 >> 56);
data[wpos++] = (byte) (uint64 >> 48);
data[wpos++] = (byte) (uint64 >> 40);