You don't have to check any of that. If you are writing an ObjectOutputStream though, you need to make sure that you write out objects that implement a Serializable interface. Otherwise your question is very short on necessary details. Please see my link below on how to ask smart questions to see what details I'm talking about that will make your question in fact answerable.
Is there a way to write to a binary file without having to check each character to see if it's a string or int, double, etc?