[FogBugz #521] Compression oracle #584
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Assigned To: Frederik Benoist
Project: Mobile Portal
Area: Divers
Category: Article Programme
Priority: A faire si temps disponible
Event ID: 2381
Date: 2016-10-25T05:58:32Z
Person: Frederik Benoist
Description: Modifié par Frederik Benoist
// permettra de rendre le texte lisible en JSON
inputStream in = IOUtils.toInputStream(StringEscapeUtils.escapeHtml(ptext)); // ,"UTF8")Event ID: 2380
Date: 2016-10-25T05:48:30Z
Person: Frederik Benoist
Description: Modifié par Frederik Benoist
org.json.simple.JSONObject.escape() escapes quotes,\, /, \r, \n, \b, \f, \t and other control characters. It can be used to escape JavaScript codes.
i
mport org.json.simple.JSONObject;String test = JSONObject.escape("your string");
Event ID: 2379
Date: 2016-10-25T05:21:01Z
Person: Frederik Benoist
Description: Modifié par Frederik Benoist
Event ID: 2378
Date: 2016-10-25T05:20:43Z
Person: Frederik Benoist
Description: Modifié par Frederik Benoist
On peut utiliser aussi le base64 :
Event ID: 2377
Date: 2016-10-25T04:47:27Z
Person: Frederik Benoist
Description: Modifié par Frederik Benoist
SET SERVEROUTPUT ON DECLARE l_in_blob BLOB; l_compressed_blob BLOB; l_uncompressed_blob BLOB; BEGIN -- Set some values l_in_blob := TO_BLOB(UTL_RAW.CAST_TO_RAW ('This is a long string of words used for this example')); l_compressed_blob := TO_BLOB('0'); l_uncompressed_blob := TO_BLOB('0'); -- Compress the string UTL_COMPRESS.lz_compress (src => l_in_blob, dst => l_compressed_blob); -- Uncompress the string UTL_COMPRESS.lz_uncompress (src => l_compressed_blob, dst => l_uncompressed_blob); -- Compare the results with the input DBMS_OUTPUT.put_line('Input length is : ' || LENGTH(l_in_blob)); DBMS_OUTPUT.put_line('Compressed length : ' || LENGTH(l_compressed_blob)); DBMS_OUTPUT.put_line('Uncompressed length: ' || LENGTH(l_uncompressed_blob)); -- Caller responsibility to free up temporary LOBs -- See Operational Notes in the documentation DBMS_LOB.FREETEMPORARY(l_in_blob); DBMS_LOB.FREETEMPORARY(l_compressed_blob); DBMS_LOB.FREETEMPORARY(l_uncompressed_blob); END; /Event ID: 2376
Date: 2016-10-25T04:46:39Z
Person: Frederik Benoist
Description: Attribué à Frederik Benoist par Frederik Benoist
Event ID: 2375
Date: 2016-10-25T04:46:39Z
Person: Frederik Benoist
Description: Ouvert par Frederik Benoist