ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
dos.writeUTF(username);
BASE64Encoder encoder = new BASE64Encoder();
String encodepass = encoder.encode(password.getBytes("UTF8"));
dos.writeUTF(encodepass);
dos.flush();
response = bos.toByteArray();
dos.close();
return response;