bif = new BufferedInputStream(conn.getInputStream());
byte[] buffer = new byte[conn.getContentLength()];
bif.read(buffer);
bif.close();
ByteToCharConverter converter = ByteToCharConverter.getConverter("UTF-8");
char c[] = converter.convertAll(buffer);
String credential = new String(c);