I'm not quite sure what you're really trying to achieve here. You can't determine what method the remote end is using, since everything will resolve to sending a stream of bytes.
So at your end you will receive a stream of bytes, and then you have to identify what that will represent. What is the set of formats you're looking to identify ? Can you enumerate these ? Can you control how the remote end sends them ? If so, I would implement some form of header, such that (say) the first byte identifies the type (e.g. a string, an array of numbers etc.) and then your client can switch modes appropriately.
If you can use Java object serialisation and the appropriate object streams, then you can resolve a Java Object, and then use instanceof e.g.
ObjectInputStream ois = new ObjectInputStream(is);
Object obj = ois.readObject();
if (obj instanceof String) {
// do string-related stuff
}
etc. This presupposes that you can change your remote end (not sure about that though!)