use GetPrimitiveArrayCritical to avoid a copy