1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
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
;
13 * Wraps a byte array to provide unsigned integer access to it.
15 * @see ByteIntegerArray
18 public final class UnsignedByteIntegerArray
19 implements IntegerArray
21 /** The backed array. */
22 protected final byte[] array
;
25 * Initializes the array wrapper.
27 * @param __a The array to wrap.
28 * @throws NullPointerException On null arguments.
31 public UnsignedByteIntegerArray(byte[] __a
)
32 throws NullPointerException
35 throw new NullPointerException("NARG");
44 @SuppressWarnings("MagicNumber")
46 public final int get(int __i
)
48 return this.array
[__i
] & 0xFF;
56 public final void set(int __i
, int __v
)
58 this.array
[__i
] = (byte)__v
;
66 public final int size()
68 return this.array
.length
;