throw new IOException(
"Cannot authenticate with principal of type "
+ principal.getClass().getName());
}
if (principal != null) {
BasicPrincipal basic = (BasicPrincipal) principal;
_out.writeByte(AUTH_BASIC);
_out.writeUTF(basic.getName());
_out.writeUTF(basic.getPassword());
} else {
_out.writeByte(AUTH_NONE);
}
_out.flush();
if (_in.readByte() != AUTH_OK) {