"The returned PasswordAuthentication must not be null");
}
String user = authentication.getUserName();
String pass = new String(authentication.getPassword());
MessageBuffer msg =
new MessageBuffer(2 +
MessageBuffer.getSize(user) +
MessageBuffer.getSize(pass));
msg.putByte(SimpleSgsProtocol.LOGIN_REQUEST).
putByte(SimpleSgsProtocol.VERSION).
putString(user).
putString(pass);
try {
sendRaw(ByteBuffer.wrap(msg.getBuffer()).asReadOnlyBuffer());
} catch (IOException e) {
logger.logThrow(Level.FINE, e, "During login request:");
logout(true);
}
}