# Why do the primitive array classes need to be exposed?

**URL:** <https://discuss.kotlinlang.org/t/why-do-the-primitive-array-classes-need-to-be-exposed/1455>\
**Category:** Language Design\
**Created:** [February 7, 2016, 8:29pm UTC](https://discuss.kotlinlang.org/t/why-do-the-primitive-array-classes-need-to-be-exposed/1455 "2016-02-07T20:29:02Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![norswap](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/norswap/32/1737_2.png) [@norswap](https://discuss.kotlinlang.org/u/norswap)\
**Post date:** [February 24, 2016, 6:26pm UTC](https://discuss.kotlinlang.org/t/why-do-the-primitive-array-classes-need-to-be-exposed/1455/7 "2016-02-24T18:26:09Z")

</div>

We’re comparing having a native array (`int[]`) and a wrapped one (`Integer[]`).

The native one is faster to read/write, but the wrapped does not need to be entirely converted each time it crosses a generic boundary.

If you are going to use generic operations, the native array will only perform better in cases where the ratio of native access vs wrapped access (in the generic methods) is very high. In the generic method, you pay the regular wrapped read/write overhead but also the overhead of wrapping the whole array.

---

_[View the full topic](https://discuss.kotlinlang.org/t/why-do-the-primitive-array-classes-need-to-be-exposed/1455)._
