Make Exported just be SquirrelJMEVendorApi.
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / runtime / cldc / util / ByteIntegerArray.java
blob3693e2b290cb2a84e46426c0ac8d97c561a49e79
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.runtime.cldc.util;
12 /**
13 * Wraps a byte array to provide integer access to it.
15 * @see UnsignedByteIntegerArray
16 * @since 2019/05/09
18 public final class ByteIntegerArray
19 implements IntegerArray
21 /** The backed array. */
22 protected final byte[] array;
24 /**
25 * Initializes the array wrapper.
27 * @param __a The array to wrap.
28 * @throws NullPointerException On null arguments.
29 * @since 2019/05/09
31 public ByteIntegerArray(byte[] __a)
32 throws NullPointerException
34 if (__a == null)
35 throw new NullPointerException("NARG");
37 this.array = __a;
40 /**
41 * {@inheritDoc}
42 * @since 2019/05/09
44 @Override
45 public final int get(int __i)
47 return this.array[__i];
50 /**
51 * {@inheritDoc}
52 * @since 2019/05/09
54 @Override
55 public final void set(int __i, int __v)
57 this.array[__i] = (byte)__v;
60 /**
61 * {@inheritDoc}
62 * @since 2019/05/09
64 @Override
65 public final int size()
67 return this.array.length;