bd-jb/src/com/bdjb/api/Int8.java

46 lines
811 B
Java
Raw Normal View History

2021-11-06 07:32:04 -04:00
/*
* Copyright (C) 2021 Andy Nguyen
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
package com.bdjb.api;
2021-11-13 03:38:01 -05:00
public final class Int8 extends AbstractInt {
2021-11-06 07:32:04 -04:00
public static final int SIZE = 1;
public Int8(int[] dimensions) {
super(dimensions);
}
public Int8() {
super();
}
public Int8(byte value) {
this();
this.set(value);
}
protected int elementSize() {
2021-11-06 07:32:04 -04:00
return SIZE;
}
public byte get() {
return api.read8(address);
}
public void set(byte value) {
api.write8(address, value);
}
public byte get(int[] indices) {
return api.read8(address + offset(indices));
}
public void set(int[] indices, byte value) {
api.write8(address + offset(indices), value);
}
}