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 ) { Util . log ( "IOException in encodeCookie" , e ) ; return null ; } return byteArrayToHexString ( os . toByteArray ( ) ) ; }
Serializes Cookie object into String