Skip to content

Commit

Permalink
Minor cleanup wrt test for #312
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 26, 2022
1 parent 7f203f1 commit 2f293e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Expand Up @@ -2902,9 +2902,9 @@ private final String _findDecodedFromSymbols(final int len) throws IOException

// First quadbyte is easy
int q1 = (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);

if (len < 9) {
int q2 = (inBuf[inPtr++] & 0xFF);
Expand Down Expand Up @@ -3006,7 +3006,15 @@ private final String _addDecodedToSymbols(int len, String name) {

private static int[] _growArrayTo(int[] arr, int minSize) {
return Arrays.copyOf(arr, minSize+4);
}
}

// Helper method needed to fix [dataformats-binary#312], masking of 0x00 character
// 26-Feb-2022, tatu: not yet used
/*
private final static int _padLastQuad(int q, int bytes) {
return (bytes == 4) ? q : (q | (-1 << (bytes << 3)));
}
*/

/*
/**********************************************************
Expand Down
Expand Up @@ -17,7 +17,7 @@ public void testNullHandling() throws Exception
final String FIELD3 = FIELD2 + FIELD1;

final String QUOTED_NULL = "\\u0000";

final String SRC = a2q(String.format("{'%s':'a','%s':'b','%s':'c'}",
QUOTED_NULL, QUOTED_NULL+QUOTED_NULL, QUOTED_NULL+QUOTED_NULL+QUOTED_NULL));
byte[] DOC = cborDoc(SRC);
Expand Down

0 comments on commit 2f293e4

Please sign in to comment.