Make Exported just be SquirrelJMEVendorApi.
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / runtime / cldc / util / UnsignedByteIntegerArray.java
blobb93a4993ce5e5b93dd6a19d9f6e7eaf0e2f8ecac
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 unsigned integer access to it.
15 * @see ByteIntegerArray
16 * @since 2021/07/12
18 public final class UnsignedByteIntegerArray
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 2021/07/12
31 public UnsignedByteIntegerArray(byte[] __a)
32 throws NullPointerException
34 if (__a == null)
35 throw new NullPointerException("NARG");
37 this.array = __a;
40 /**
41 * {@inheritDoc}
42 * @since 2021/07/12
44 @SuppressWarnings("MagicNumber")
45 @Override
46 public final int get(int __i)
48 return this.array[__i] & 0xFF;
51 /**
52 * {@inheritDoc}
53 * @since 2021/07/12
55 @Override
56 public final void set(int __i, int __v)
58 this.array[__i] = (byte)__v;
61 /**
62 * {@inheritDoc}
63 * @since 2021/07/12
65 @Override
66 public final int size()
68 return this.array.length;