{"action":"created","issue":{"url":"https://api.github.com/repos/jpountz/lz4-java/issues/88","repository_url":"https://api.github.com/repos/jpountz/lz4-java","labels_url":"https://api.github.com/repos/jpountz/lz4-java/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/jpountz/lz4-java/issues/88/comments","events_url":"https://api.github.com/repos/jpountz/lz4-java/issues/88/events","html_url":"https://github.com/jpountz/lz4-java/issues/88","id":184147245,"number":88,"title":"How should I initial the length for dest byte[] when i don't know the decompressed length","user":{"login":"zhangjiajie023","id":14030724,"avatar_url":"https://avatars.githubusercontent.com/u/14030724?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangjiajie023","html_url":"https://github.com/zhangjiajie023","followers_url":"https://api.github.com/users/zhangjiajie023/followers","following_url":"https://api.github.com/users/zhangjiajie023/following{/other_user}","gists_url":"https://api.github.com/users/zhangjiajie023/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjiajie023/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjiajie023/subscriptions","organizations_url":"https://api.github.com/users/zhangjiajie023/orgs","repos_url":"https://api.github.com/users/zhangjiajie023/repos","events_url":"https://api.github.com/users/zhangjiajie023/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjiajie023/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-20T06:42:36Z","updated_at":"2016-10-20T06:59:11Z","closed_at":null,"body":"byte[] restored = new byte[decompressedLength];\r\n// - method 2: when the compressed length is known (a little slower)\r\n    // the destination buffer needs to be over-sized\r\n    LZ4SafeDecompressor decompressor2 = factory.safeDecompressor();\r\n    int decompressedLength2 = decompressor2.decompress(compressed, 0, compressedLength, restored, 0);\r\n\r\nthis example has initial a correct length for restored to decompress. \r\n\r\nBut when i don't know the  decompressed length, how should I initial the length fordest byte[]? \r\n\r\nI tried to byte[] restored = new byte[1];  failed, definitely;\r\nI used the decompress(ByteBuffer src, ByteBuffer dest), initial the capacity of dest to be 1, failed too;\r\n\r\nso the dest must be set a longer length than it should be, right? could u tell me how to use the safeDecompress(..)? \r\ntks for your answer\r\n"},"comment":{"url":"https://api.github.com/repos/jpountz/lz4-java/issues/comments/255024923","html_url":"https://github.com/jpountz/lz4-java/issues/88#issuecomment-255024923","issue_url":"https://api.github.com/repos/jpountz/lz4-java/issues/88","id":255024923,"user":{"login":"zhangjiajie023","id":14030724,"avatar_url":"https://avatars.githubusercontent.com/u/14030724?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangjiajie023","html_url":"https://github.com/zhangjiajie023","followers_url":"https://api.github.com/users/zhangjiajie023/followers","following_url":"https://api.github.com/users/zhangjiajie023/following{/other_user}","gists_url":"https://api.github.com/users/zhangjiajie023/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjiajie023/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjiajie023/subscriptions","organizations_url":"https://api.github.com/users/zhangjiajie023/orgs","repos_url":"https://api.github.com/users/zhangjiajie023/repos","events_url":"https://api.github.com/users/zhangjiajie023/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjiajie023/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T06:59:11Z","updated_at":"2016-10-20T06:59:11Z","body":"Someone suggested that set the dest.length to be src.length * 3 or more, is it suitable, or any other better solution ?"}}
{"actor":{"display_login":"zhangjiajie023"}}