private void checkSize(int size) {
        if (_next + size != _size) {
            if (_next + size >= _size) {
                throw new MalformedValueException("Not enough bytes in Value at index=" + (_next - 1));
            }
            if (_depth == 0) {
                throw new MalformedValueException("Too many bytes in Value at index=" + (_next - 1));
            }
        }
    }