public ConfigurationData readConfigurationData(InputStream in) throws IOException, ClassNotFoundException {
PushbackInputStream pushbackInputStream = new PushbackInputStream(in, 2);
byte[] streamHeader = new byte[2];
if (pushbackInputStream.read(streamHeader) != 2) throw new AssertionError("Cound not read stream header");
pushbackInputStream.unread(streamHeader);
// if this is a serialized config, fallback to the serialization marshaler
if (SERIALIZED_MAGIC[0] == streamHeader[0] && SERIALIZED_MAGIC[1] == streamHeader[1]) {
return new SerializedConfigurationMarshaler().readConfigurationData(pushbackInputStream);
}