create convenient byte and int setter

This commit is contained in:
REAndroid 2023-03-25 06:40:42 -04:00
parent bedaf09e20
commit d66eeea70a

View File

@ -80,6 +80,9 @@ public class ByteArray extends BlockItem {
}
return 0xff & b;
}
public final void put(int index, int byteValue){
put(index, (byte) byteValue);
}
public final void put(int index, byte value){
byte[] bts = getBytesInternal();
bts[index]=value;
@ -101,6 +104,9 @@ public class ByteArray extends BlockItem {
val=left|right;
put(byteOffset, (byte) val);
}
public final void putShort(int offset, int value){
putShort(offset, (short) value);
}
public final void putShort(int offset, short val){
byte[] bts = getBytesInternal();
bts[offset+1]= (byte) (val >>> 8 & 0xff);