mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0 DB exception improvements/cleanup
This commit is contained in:
@@ -125,7 +125,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int setBytes(ByteBuffer buf, int dstOffset, int len, int blockNum) throws IOException {
|
||||
public int setBytes(ByteBuffer buf, int dstOffset, int len, int blockNum)
|
||||
throws IndexOutOfBoundsException, IOException {
|
||||
assert isSane(dstOffset, len, blockNum);
|
||||
if (compressed) {
|
||||
decompress();
|
||||
@@ -136,7 +137,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
|
||||
return len;
|
||||
}
|
||||
|
||||
public int getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) throws IOException {
|
||||
public int getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum)
|
||||
throws IndexOutOfBoundsException, IOException {
|
||||
assert isSane(srcOffset, len, blockNum);
|
||||
if (compressed) {
|
||||
return doGetCompressedBytes(buf, srcOffset, len, blockNum);
|
||||
@@ -161,7 +163,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
|
||||
}
|
||||
}
|
||||
|
||||
protected void doGetBlock(int blockNum, byte[] data) throws IOException {
|
||||
protected void doGetBlock(int blockNum, byte[] data)
|
||||
throws IndexOutOfBoundsException, IOException {
|
||||
assert isInUse(blockNum);
|
||||
if (compressed) {
|
||||
doGetCompressedBlock(blockNum, data);
|
||||
@@ -180,7 +183,7 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
|
||||
}
|
||||
|
||||
public void copyFrom(int dstBlockNum, DBTraceMemoryBufferEntry srcBuf, int srcBlockNum)
|
||||
throws IOException {
|
||||
throws IndexOutOfBoundsException, IOException {
|
||||
assert isInUse(dstBlockNum);
|
||||
if (compressed) {
|
||||
decompress();
|
||||
@@ -190,7 +193,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
|
||||
buffer.put(dstBlockNum << DBTraceMemorySpace.BLOCK_SHIFT, data);
|
||||
}
|
||||
|
||||
public int cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) throws IOException {
|
||||
public int cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum)
|
||||
throws IndexOutOfBoundsException, IOException {
|
||||
assert isSane(blkOffset, len, blockNum);
|
||||
if (compressed) {
|
||||
return doCmpCompressedBytes(buf, blkOffset, len, blockNum);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DBBufferInputStream extends InputStream {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b) throws IOException {
|
||||
public int read(byte[] b) throws IndexOutOfBoundsException, IOException {
|
||||
if (offset == buffer.length()) {
|
||||
return -1;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class DBBufferInputStream extends InputStream {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
public int read(byte[] b, int off, int len) throws IndexOutOfBoundsException, IOException {
|
||||
if (offset == buffer.length()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user