making code greener

This commit is contained in:
rusefillc 2021-12-18 09:25:23 -05:00
parent d35378f3a9
commit fcf53fa710
1 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@ public class ConfigurationImage {
* 2) as RomRaider RomID#internalIdString
*/
public final static String BIN_HEADER = "OPEN_SR5_0.1";
private byte content[];
private final byte[] content;
public ConfigurationImage(int size) {
content = new byte[size];
@ -49,13 +49,16 @@ public class ConfigurationImage {
return content;
}
@SuppressWarnings("CloneDoesntCallSuperClone")
@SuppressWarnings("MethodDoesntCallSuperMethod")
@Override
public ConfigurationImage clone() {
byte[] copy = content.clone();
return new ConfigurationImage(copy);
}
/**
* @return a COPY of the specified range
*/
public byte[] getRange(int offset, int size) {
byte[] r = new byte[size];
System.arraycopy(content, offset, r, 0, size);