protected String encodeCookie(SerializableHttpCookie cookie){
  if (cookie == null)   return null;
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  try {
    ObjectOutputStream outputStream=new ObjectOutputStream(os);
    outputStream.writeObject(cookie);
  }
 catch (  IOException e) {
    Log.d(LOG_TAG,"IOException in encodeCookie",e);
    return null;
  }
  return byteArrayToHexString(os.toByteArray());
}

protected String encodeCookie ( SerializableHttpCookie cookie ) { if ( cookie == null ) return null ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; try { ObjectOutputStream outputStream = new ObjectOutputStream ( os ) ; outputStream . writeObject ( cookie ) ; } catch ( IOException e ) { Log . d ( LOG_TAG , "IOException in encodeCookie" , e ) ; return null ; } return byteArrayToHexString ( os . toByteArray ( ) ) ; }
serializes cookie object into string
