public short[] getArray() {
    int cursor = cursor();

    if (cursor == array.length) {
      return array;
    }

    short[] result = new short[cursor];
    System.arraycopy(array, 0, result, 0, cursor);
    return result;
  }
Gets the array. The returned array contains exactly the data written (e.g. no leftover space at
the end).
android/android_framework/dex-maker/src/main/java/com/android/dx/io/instructions/ShortArrayCodeOutput.java