* sent out
* @param len number of bytes to be sent out
* @throws IOException if problems encountered
*/
void write(byte[] buf, int offset, int len) throws IOException {
MessageProp prop;
if (doEncryption) {
prop = new MessageProp(PRIVACY_QOP, true);
} else { // 2 means "integrity using DES MAC of MD5 of plaintext"
prop = new MessageProp(INTEGRITY_QOP, false);
}
byte[] token = null;
try {
try {
synchronized (gssContext) {
token = gssContext.wrap(buf, offset, len, prop);
}
} catch (GSSException ge) {
IOException ioe = new IOException(
"Failed to wrap buf into GSS token.");
ioe.initCause(ge);
throw ioe;
}
if (doEncryption != prop.getPrivacy()) {
throw new IOException(
"Returned token encryption property is: " +
prop.getPrivacy() + ",\nwhile connection " +
"encryption requirement is: " + doEncryption);
}
if (connectionLogger.isLoggable(Level.FINEST)) {
connectionLogger.log(