Source:
<code><START> protected void skipValueWithSwitch() throws IOException { <END> int remainingValues = 1; while(remainingValues > 0) { MessageFormat f = getNextFormat(); byte b = lookAhead(); consume(); switch(f) { case EOF: return; case POSFIXINT: case NEGFIXINT: case BOOLEAN: case NIL: break; case FIXMAP: { int mapLen = b & 0x0f; remainingValues += mapLen * 2; break; } case FIXARRAY: { int arrayLen = b & 0x0f; remainingValues += arrayLen; break; } case FIXSTR: { int strLen = b & 0x1f; consume(strLen); break; } case INT8: case UINT8: consume(1); break; case INT16: case UINT16: consume(2); break; case INT32: case UINT32: case FLOAT32: consume(4); break; case INT64: case UINT64: case FLOAT64: consume(8); break; case BIN8: case STR8: consume(readNextLength8()); break; case BIN16: case STR16: consume(readNextLength16()); break; case BIN32: case STR32: consume(readNextLength32()); break; case FIXEXT1: consume(2); break; case FIXEXT2: consume(3); break; case FIXEXT4: consume(5); break; case FIXEXT8: consume(9); break; case FIXEXT16: consume(17); break; case EXT8: consume(readNextLength8() + 1); break; case EXT16: consume(readNextLength16() + 1); break; case EXT32: consume(readNextLength32() + 1); break; case ARRAY16: remainingValues += readNextLength16(); consume(2); break; case ARRAY32: remainingValues += readNextLength32(); consume(4); break; case MAP16: remainingValues += readNextLength16() * 2; consume(2); break; case MAP32: remainingValues += readNextLength32() * 2; consume(2); break; case UNKNOWN: throw new MessageFormatException(String.format("unknown code: %02x is found", b)); } remainingValues--; } }</code><technical_language>fix string, fix array, fix map fix ext needs length type. pseudo code encoded length 8 bits</technical_language>

Target:
protected void skipValueWithSwitch() throws IOException { int remainingValues = 1; while(remainingValues > 0) { MessageFormat f = getNextFormat(); byte b = lookAhead(); consume(); switch(f) { case POSFIXINT: case NEGFIXINT: case BOOLEAN: case NIL: break; case FIXMAP: { int mapLen = b & 0x0f; remainingValues += mapLen * 2; break; } case FIXARRAY: { int arrayLen = b & 0x0f; remainingValues += arrayLen; break; } case FIXSTR: { int strLen = b & 0x1f; consume(strLen); break; } case INT8: case UINT8: consume(1); break; case INT16: case UINT16: consume(2); break; case INT32: case UINT32: case FLOAT32: consume(4); break; case INT64: case UINT64: case FLOAT64: consume(8); break; case BIN8: case STR8: consume(readNextLength8()); break; case BIN16: case STR16: consume(readNextLength16()); break; case BIN32: case STR32: consume(readNextLength32()); break; case FIXEXT1: consume(2); break; case FIXEXT2: consume(3); break; case FIXEXT4: consume(5); break; case FIXEXT8: consume(9); break; case FIXEXT16: consume(17); break; case EXT8: consume(readNextLength8() + 1); break; case EXT16: consume(readNextLength16() + 1); break; case EXT32: consume(readNextLength32() + 1); break; case ARRAY16: remainingValues += readNextLength16(); consume(2); break; case ARRAY32: remainingValues += readNextLength32(); consume(4); break; case MAP16: remainingValues += readNextLength16() * 2; consume(2); break; case MAP32: remainingValues += readNextLength32() * 2; consume(2); break; case NEVER_USED: throw new MessageFormatException(String.format("unknown code: %02x is found", b)); } remainingValues--; } }