public static String deserializeRequest ( String request ) throws IllegalArgumentException , ProtocolVersionException { MiniMessagePack . Unpacker unpacker = new MiniMessagePack . Unpacker ( ASCIICodec . decode ( request ) ) ; try { parseVersionMagic ( REQUEST_MAGIC , unpacker ) ; return unpacker . unpackString ( ) ; } catch ( DeserializationException e ) { throw new IllegalArgumentException ( e . getMessage ( ) ) ; } }
Deserialize an ASCII encoded request messages and return the username string it encodes . Also verifies that the type magic value matches and that the version equals 1 .