Last active
August 29, 2015 14:03
-
-
Save wendal/f48dc7bc6a71f3bb76a5 to your computer and use it in GitHub Desktop.
被坑了一天, Java类型的问题
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// data is byte[] | |
// tmp is OutputStream | |
for (int i = 0; i < data.length; i++) { | |
int b = data[i]; | |
switch (b) { | |
case 0x55: | |
case 0xAA: | |
case 0xBB: | |
log.info("Found sp=" + Integer.toHexString(b)); | |
tmp.write(0xBB); | |
tmp.write(data[i] + 1); | |
break; | |
default : | |
tmp.write(data[i]); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment