Object t1m = t1Mconstructor.newInstance(
new Object[] { new Integer(flags), domain, workstation });
if (debugout != null)
debugout.println("DEBUG NTLM: type 1 message: " + t1m);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
BASE64EncoderStream out =
new BASE64EncoderStream(bout, Integer.MAX_VALUE);
if (debugout != null)
debugout.println("DEBUG NTLM: type 1 message length: " +
((byte[]) t1MClass.getMethod("toByteArray",
new Class[0]).invoke(t1m, null)).length);
out.write((byte[]) t1MClass.getMethod("toByteArray",
new Class[0]).invoke(t1m, null));
out.flush();
out.close();
return new String(bout.toByteArray());
} catch (IOException ioex) {
if (debugout != null)
ioex.printStackTrace(debugout);
throw ioex; // pass it on