java Cast and architecture io