} else if (arg instanceof byte[]) {
in = new ByteArrayInputStream((byte[]) arg);
} else if (arg instanceof MimePart) {
in = new ByteArrayInputStream(((MimePart) arg).getContent());
} else if (arg instanceof File) {
in = new FileInputStream((File) arg);
} else if (arg instanceof FileObject) {
in = new FileInputStream(((FileObject)arg).getFile());
} else if (arg instanceof String) {
String str = (String) arg;
// try to interpret argument as URL if it contains a colon,
// otherwise or if URL is malformed interpret as file name.
if (str.indexOf(":") > -1) {
try {
URL url = new URL(str);
in = url.openStream();
} catch (MalformedURLException mux) {
in = new FileInputStream(str);
}
} else {
in = new FileInputStream(str);
}
}
if (in == null) {
String msg = "Unrecognized argument in Image.getInfo(): ";