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

42 lines
731 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, SIZE);
2021-11-06 07:32:04 -04:00
}
public Int8() {
super(SIZE);
2021-11-06 07:32:04 -04:00
}
public Int8(byte value) {
this();
this.set(value);
}
public byte get() {
return getByte(0x00);
2021-11-06 07:32:04 -04:00
}
public void set(byte value) {
putByte(0x00, value);
2021-11-06 07:32:04 -04:00
}
public byte get(int[] indices) {
return getByte(offset(indices));
2021-11-06 07:32:04 -04:00
}
public void set(int[] indices, byte value) {
putByte(offset(indices), value);
2021-11-06 07:32:04 -04:00
}
}