{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments/123366234","pull_request_review_id":45563335,"id":123366234,"diff_hunk":"@@ -64,20 +120,61 @@ internal static TransformationStatus Compress(ReadOnlySpan<byte> source, Span<by\n                     bufOut = new IntPtr(outBytes);\n                     nuint written = (nuint)destination.Length;\n                     nuint consumed = (nuint)source.Length;\n-                    if (!BrotliNative.BrotliEncoderCompress(quality, windowSize, encMode, consumed, bufIn, ref written, bufOut))\n+                    if (!BrotliNative.BrotliEncoderCompressStream(state.BrotliNativeState, operation, ref consumed, ref bufIn, ref written, ref bufOut, out nuint totalOut))\n                     {\n                         return TransformationStatus.InvalidData;\n-                    };\n+                    }\n                     bytesConsumed = (int)consumed;\n                     bytesWritten = (int)written;\n-                    return TransformationStatus.Done;\n                 }\n+                bytesWritten = destination.Length - bytesWritten;","path":"src/System.IO.Compression.Brotli/System/IO/Compression/Brotli.cs","position":107,"original_position":107,"commit_id":"5a6f0377cdcf497a2293c1e09b60a508ec3ff269","original_commit_id":"5a6f0377cdcf497a2293c1e09b60a508ec3ff269","user":{"login":"Vedin","id":22378647,"avatar_url":"https://avatars2.githubusercontent.com/u/22378647?v=3","gravatar_id":"","url":"https://api.github.com/users/Vedin","html_url":"https://github.com/Vedin","followers_url":"https://api.github.com/users/Vedin/followers","following_url":"https://api.github.com/users/Vedin/following{/other_user}","gists_url":"https://api.github.com/users/Vedin/gists{/gist_id}","starred_url":"https://api.github.com/users/Vedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vedin/subscriptions","organizations_url":"https://api.github.com/users/Vedin/orgs","repos_url":"https://api.github.com/users/Vedin/repos","events_url":"https://api.github.com/users/Vedin/events{/privacy}","received_events_url":"https://api.github.com/users/Vedin/received_events","type":"User","site_admin":false},"body":"because bytesWritten after calling a native func is: \"how many bytes have already free\", and we convert it to how many bytes have already written","created_at":"2017-06-21T21:08:06Z","updated_at":"2017-06-21T21:08:06Z","html_url":"https://github.com/dotnet/corefxlab/pull/1621#discussion_r123366234","pull_request_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments/123366234"},"html":{"href":"https://github.com/dotnet/corefxlab/pull/1621#discussion_r123366234"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621","id":126838177,"html_url":"https://github.com/dotnet/corefxlab/pull/1621","diff_url":"https://github.com/dotnet/corefxlab/pull/1621.diff","patch_url":"https://github.com/dotnet/corefxlab/pull/1621.patch","issue_url":"https://api.github.com/repos/dotnet/corefxlab/issues/1621","number":1621,"state":"open","locked":false,"title":"Api brotli changes","user":{"login":"Vedin","id":22378647,"avatar_url":"https://avatars2.githubusercontent.com/u/22378647?v=3","gravatar_id":"","url":"https://api.github.com/users/Vedin","html_url":"https://github.com/Vedin","followers_url":"https://api.github.com/users/Vedin/followers","following_url":"https://api.github.com/users/Vedin/following{/other_user}","gists_url":"https://api.github.com/users/Vedin/gists{/gist_id}","starred_url":"https://api.github.com/users/Vedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vedin/subscriptions","organizations_url":"https://api.github.com/users/Vedin/orgs","repos_url":"https://api.github.com/users/Vedin/repos","events_url":"https://api.github.com/users/Vedin/events{/privacy}","received_events_url":"https://api.github.com/users/Vedin/received_events","type":"User","site_admin":false},"body":"Changes to the Brotli API. What's new:\r\n\r\n1. Brotli (Primitives) was rewrote and now return all possible TransformationStatus.\r\n\r\n2. BroltiStream now base on Brotli class. Also it uses twice less memory as before and doesn't use marshaling. \r\n\r\n3. @KrzysztofCwalina Finally, I remove everything from State and rewrite all in way where we need only BrotliNativeState, So how to Dispose it know (there are 2 commented methods for compression/decompression mode? May be add some flag to detect in what mode state now?\r\n\r\n4. BrotliPrimitivesTests needs an update. \r\n\r\n ","created_at":"2017-06-21T19:07:12Z","updated_at":"2017-06-21T21:08:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a29650dd15850cdd3edf09438d6a716c2dc95306","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ianhays","id":2606879,"avatar_url":"https://avatars3.githubusercontent.com/u/2606879?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhays","html_url":"https://github.com/ianhays","followers_url":"https://api.github.com/users/ianhays/followers","following_url":"https://api.github.com/users/ianhays/following{/other_user}","gists_url":"https://api.github.com/users/ianhays/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhays/subscriptions","organizations_url":"https://api.github.com/users/ianhays/orgs","repos_url":"https://api.github.com/users/ianhays/repos","events_url":"https://api.github.com/users/ianhays/events{/privacy}","received_events_url":"https://api.github.com/users/ianhays/received_events","type":"User","site_admin":false},{"login":"KrzysztofCwalina","id":9724236,"avatar_url":"https://avatars3.githubusercontent.com/u/9724236?v=3","gravatar_id":"","url":"https://api.github.com/users/KrzysztofCwalina","html_url":"https://github.com/KrzysztofCwalina","followers_url":"https://api.github.com/users/KrzysztofCwalina/followers","following_url":"https://api.github.com/users/KrzysztofCwalina/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofCwalina/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofCwalina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofCwalina/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofCwalina/orgs","repos_url":"https://api.github.com/users/KrzysztofCwalina/repos","events_url":"https://api.github.com/users/KrzysztofCwalina/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofCwalina/received_events","type":"User","site_admin":false},{"login":"shiftylogic","id":11233697,"avatar_url":"https://avatars1.githubusercontent.com/u/11233697?v=3","gravatar_id":"","url":"https://api.github.com/users/shiftylogic","html_url":"https://github.com/shiftylogic","followers_url":"https://api.github.com/users/shiftylogic/followers","following_url":"https://api.github.com/users/shiftylogic/following{/other_user}","gists_url":"https://api.github.com/users/shiftylogic/gists{/gist_id}","starred_url":"https://api.github.com/users/shiftylogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiftylogic/subscriptions","organizations_url":"https://api.github.com/users/shiftylogic/orgs","repos_url":"https://api.github.com/users/shiftylogic/repos","events_url":"https://api.github.com/users/shiftylogic/events{/privacy}","received_events_url":"https://api.github.com/users/shiftylogic/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefxlab/issues/1621/comments","statuses_url":"https://api.github.com/repos/dotnet/corefxlab/statuses/5a6f0377cdcf497a2293c1e09b60a508ec3ff269","head":{"label":"Vedin:APIBrotliChanges2","ref":"APIBrotliChanges2","sha":"5a6f0377cdcf497a2293c1e09b60a508ec3ff269","user":{"login":"Vedin","id":22378647,"avatar_url":"https://avatars2.githubusercontent.com/u/22378647?v=3","gravatar_id":"","url":"https://api.github.com/users/Vedin","html_url":"https://github.com/Vedin","followers_url":"https://api.github.com/users/Vedin/followers","following_url":"https://api.github.com/users/Vedin/following{/other_user}","gists_url":"https://api.github.com/users/Vedin/gists{/gist_id}","starred_url":"https://api.github.com/users/Vedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vedin/subscriptions","organizations_url":"https://api.github.com/users/Vedin/orgs","repos_url":"https://api.github.com/users/Vedin/repos","events_url":"https://api.github.com/users/Vedin/events{/privacy}","received_events_url":"https://api.github.com/users/Vedin/received_events","type":"User","site_admin":false},"repo":{"id":90793529,"name":"corefxlab","full_name":"Vedin/corefxlab","owner":{"login":"Vedin","id":22378647,"avatar_url":"https://avatars2.githubusercontent.com/u/22378647?v=3","gravatar_id":"","url":"https://api.github.com/users/Vedin","html_url":"https://github.com/Vedin","followers_url":"https://api.github.com/users/Vedin/followers","following_url":"https://api.github.com/users/Vedin/following{/other_user}","gists_url":"https://api.github.com/users/Vedin/gists{/gist_id}","starred_url":"https://api.github.com/users/Vedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vedin/subscriptions","organizations_url":"https://api.github.com/users/Vedin/orgs","repos_url":"https://api.github.com/users/Vedin/repos","events_url":"https://api.github.com/users/Vedin/events{/privacy}","received_events_url":"https://api.github.com/users/Vedin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Vedin/corefxlab","description":"This repo is for experimentation and exploring new ideas that may or may not make it into the main corefx repo.","fork":true,"url":"https://api.github.com/repos/Vedin/corefxlab","forks_url":"https://api.github.com/repos/Vedin/corefxlab/forks","keys_url":"https://api.github.com/repos/Vedin/corefxlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Vedin/corefxlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Vedin/corefxlab/teams","hooks_url":"https://api.github.com/repos/Vedin/corefxlab/hooks","issue_events_url":"https://api.github.com/repos/Vedin/corefxlab/issues/events{/number}","events_url":"https://api.github.com/repos/Vedin/corefxlab/events","assignees_url":"https://api.github.com/repos/Vedin/corefxlab/assignees{/user}","branches_url":"https://api.github.com/repos/Vedin/corefxlab/branches{/branch}","tags_url":"https://api.github.com/repos/Vedin/corefxlab/tags","blobs_url":"https://api.github.com/repos/Vedin/corefxlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Vedin/corefxlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Vedin/corefxlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/Vedin/corefxlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Vedin/corefxlab/statuses/{sha}","languages_url":"https://api.github.com/repos/Vedin/corefxlab/languages","stargazers_url":"https://api.github.com/repos/Vedin/corefxlab/stargazers","contributors_url":"https://api.github.com/repos/Vedin/corefxlab/contributors","subscribers_url":"https://api.github.com/repos/Vedin/corefxlab/subscribers","subscription_url":"https://api.github.com/repos/Vedin/corefxlab/subscription","commits_url":"https://api.github.com/repos/Vedin/corefxlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/Vedin/corefxlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/Vedin/corefxlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/Vedin/corefxlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/Vedin/corefxlab/contents/{+path}","compare_url":"https://api.github.com/repos/Vedin/corefxlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Vedin/corefxlab/merges","archive_url":"https://api.github.com/repos/Vedin/corefxlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Vedin/corefxlab/downloads","issues_url":"https://api.github.com/repos/Vedin/corefxlab/issues{/number}","pulls_url":"https://api.github.com/repos/Vedin/corefxlab/pulls{/number}","milestones_url":"https://api.github.com/repos/Vedin/corefxlab/milestones{/number}","notifications_url":"https://api.github.com/repos/Vedin/corefxlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Vedin/corefxlab/labels{/name}","releases_url":"https://api.github.com/repos/Vedin/corefxlab/releases{/id}","deployments_url":"https://api.github.com/repos/Vedin/corefxlab/deployments","created_at":"2017-05-09T21:28:47Z","updated_at":"2017-05-09T21:28:50Z","pushed_at":"2017-06-21T19:26:14Z","git_url":"git://github.com/Vedin/corefxlab.git","ssh_url":"git@github.com:Vedin/corefxlab.git","clone_url":"https://github.com/Vedin/corefxlab.git","svn_url":"https://github.com/Vedin/corefxlab","homepage":"","size":40137,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"de197e6987b400fff4b1eb644b6f4c7f1d5cb57d","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars3.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29504192,"name":"corefxlab","full_name":"dotnet/corefxlab","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars3.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefxlab","description":"This repo is for experimentation and exploring new ideas that may or may not make it into the main corefx repo.","fork":false,"url":"https://api.github.com/repos/dotnet/corefxlab","forks_url":"https://api.github.com/repos/dotnet/corefxlab/forks","keys_url":"https://api.github.com/repos/dotnet/corefxlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefxlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefxlab/teams","hooks_url":"https://api.github.com/repos/dotnet/corefxlab/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefxlab/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefxlab/events","assignees_url":"https://api.github.com/repos/dotnet/corefxlab/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefxlab/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefxlab/tags","blobs_url":"https://api.github.com/repos/dotnet/corefxlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefxlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefxlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefxlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefxlab/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefxlab/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefxlab/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefxlab/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefxlab/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefxlab/subscription","commits_url":"https://api.github.com/repos/dotnet/corefxlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefxlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefxlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefxlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefxlab/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefxlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefxlab/merges","archive_url":"https://api.github.com/repos/dotnet/corefxlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefxlab/downloads","issues_url":"https://api.github.com/repos/dotnet/corefxlab/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefxlab/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefxlab/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefxlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefxlab/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefxlab/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefxlab/deployments","created_at":"2015-01-20T00:44:35Z","updated_at":"2017-06-20T04:17:24Z","pushed_at":"2017-06-21T19:26:16Z","git_url":"git://github.com/dotnet/corefxlab.git","ssh_url":"git@github.com:dotnet/corefxlab.git","clone_url":"https://github.com/dotnet/corefxlab.git","svn_url":"https://github.com/dotnet/corefxlab","homepage":"","size":38955,"stargazers_count":733,"watchers_count":733,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":205,"mirror_url":null,"open_issues_count":212,"forks":205,"open_issues":212,"watchers":733,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621"},"html":{"href":"https://github.com/dotnet/corefxlab/pull/1621"},"issue":{"href":"https://api.github.com/repos/dotnet/corefxlab/issues/1621"},"comments":{"href":"https://api.github.com/repos/dotnet/corefxlab/issues/1621/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/1621/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefxlab/statuses/5a6f0377cdcf497a2293c1e09b60a508ec3ff269"}}}}
{"actor":{"display_login":"Vedin"}}