Skip to content
Snippets Groups Projects
Commit b2af5376 authored by Michael Eischer's avatar Michael Eischer
Browse files

debug helper function

parent b5560947
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ package refit.util;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
public class REFITPayload {
......@@ -56,4 +57,14 @@ public class REFITPayload {
return s.toString();
}
// helper function for "evaluate expression" in the debugger
public static String bbToString(ByteBuffer bb) {
int pos = bb.position();
byte[] bytes = new byte[bb.remaining()];
bb.get(bytes);
bb.position(pos);
// return string as that way simplifies copying the full content of a message in intellij
return Arrays.toString(bytes);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment