{"action":"created","comment":{"url":"https://api.github.com/repos/airlift/slice/pulls/comments/92725879","pull_request_review_id":13247213,"id":92725879,"diff_hunk":"@@ -201,6 +203,78 @@ public static Slice reverse(Slice utf8)\n     }\n \n     /**\n+     * Compares to UTF-8 sequences using UTF-16 big endian semantics.  This is\n+     * equivilant to the {@link java.lang.String#compareTo(Object)}.\n+     * {@code java.lang.String}.\n+     * @throws InvalidUtf8Exception if the UTF-8 are invalid\n+     */\n+    public static int compareUtf16BE(Slice utf8Left, Slice utf8Right)\n+    {\n+        int leftLength = utf8Left.length();\n+        int rightLength = utf8Right.length();\n+\n+        int leftOffset = 0;\n+        int rightOffset = 0;\n+        while (leftOffset < leftLength) {\n+            // if there are no more right code points, right is less\n+            if (rightOffset >= rightLength) {\n+                return 1; // left.compare(right) > 0\n+            }\n+\n+            int leftCodePoint = tryGetCodePointAt(utf8Left, leftOffset);\n+            if (leftCodePoint < 0) {\n+                throw new InvalidUtf8Exception(\"Invalid UTF-8 sequence in utf8Left at \" + leftOffset);\n+            }\n+\n+            int rightCodePoint = tryGetCodePointAt(utf8Right, rightOffset);\n+            if (rightCodePoint < 0) {\n+                throw new InvalidUtf8Exception(\"Invalid UTF-8 sequence in utf8Right at \" + rightOffset);\n+            }\n+\n+            int result = compareUtf16BE(leftCodePoint, rightCodePoint);\n+            if (result != 0) {\n+                return result;\n+            }\n+\n+            // Since we are reading code point at a time, after this advance\n+            // in a UTF-16 sequence, we will be a the start of a single 16 bit","path":"src/main/java/io/airlift/slice/SliceUtf8.java","position":54,"original_position":54,"commit_id":"038ace978e12932e996634756fd5cf6fa49459c4","original_commit_id":"038ace978e12932e996634756fd5cf6fa49459c4","user":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"body":"typo","created_at":"2016-12-15T23:49:24Z","updated_at":"2016-12-15T23:49:24Z","html_url":"https://github.com/airlift/slice/pull/72#discussion_r92725879","pull_request_url":"https://api.github.com/repos/airlift/slice/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/airlift/slice/pulls/comments/92725879"},"html":{"href":"https://github.com/airlift/slice/pull/72#discussion_r92725879"},"pull_request":{"href":"https://api.github.com/repos/airlift/slice/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/airlift/slice/pulls/72","id":96837467,"html_url":"https://github.com/airlift/slice/pull/72","diff_url":"https://github.com/airlift/slice/pull/72.diff","patch_url":"https://github.com/airlift/slice/pull/72.patch","issue_url":"https://api.github.com/repos/airlift/slice/issues/72","number":72,"state":"open","locked":false,"title":"Add SliceUtf8.compareUtf16BE","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-12-07T00:44:47Z","updated_at":"2016-12-15T23:49:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13f65e51f7ef7c79e6d315e660b83ee14efb65fd","assignee":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"assignees":[{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/airlift/slice/pulls/72/commits","review_comments_url":"https://api.github.com/repos/airlift/slice/pulls/72/comments","review_comment_url":"https://api.github.com/repos/airlift/slice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airlift/slice/issues/72/comments","statuses_url":"https://api.github.com/repos/airlift/slice/statuses/038ace978e12932e996634756fd5cf6fa49459c4","head":{"label":"dain:compare-utf16be","ref":"compare-utf16be","sha":"038ace978e12932e996634756fd5cf6fa49459c4","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"repo":{"id":10683434,"name":"slice","full_name":"dain/slice","owner":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dain/slice","description":"Java library for efficiently working with heap and off-heap memory","fork":true,"url":"https://api.github.com/repos/dain/slice","forks_url":"https://api.github.com/repos/dain/slice/forks","keys_url":"https://api.github.com/repos/dain/slice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dain/slice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dain/slice/teams","hooks_url":"https://api.github.com/repos/dain/slice/hooks","issue_events_url":"https://api.github.com/repos/dain/slice/issues/events{/number}","events_url":"https://api.github.com/repos/dain/slice/events","assignees_url":"https://api.github.com/repos/dain/slice/assignees{/user}","branches_url":"https://api.github.com/repos/dain/slice/branches{/branch}","tags_url":"https://api.github.com/repos/dain/slice/tags","blobs_url":"https://api.github.com/repos/dain/slice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dain/slice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dain/slice/git/refs{/sha}","trees_url":"https://api.github.com/repos/dain/slice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dain/slice/statuses/{sha}","languages_url":"https://api.github.com/repos/dain/slice/languages","stargazers_url":"https://api.github.com/repos/dain/slice/stargazers","contributors_url":"https://api.github.com/repos/dain/slice/contributors","subscribers_url":"https://api.github.com/repos/dain/slice/subscribers","subscription_url":"https://api.github.com/repos/dain/slice/subscription","commits_url":"https://api.github.com/repos/dain/slice/commits{/sha}","git_commits_url":"https://api.github.com/repos/dain/slice/git/commits{/sha}","comments_url":"https://api.github.com/repos/dain/slice/comments{/number}","issue_comment_url":"https://api.github.com/repos/dain/slice/issues/comments{/number}","contents_url":"https://api.github.com/repos/dain/slice/contents/{+path}","compare_url":"https://api.github.com/repos/dain/slice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dain/slice/merges","archive_url":"https://api.github.com/repos/dain/slice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dain/slice/downloads","issues_url":"https://api.github.com/repos/dain/slice/issues{/number}","pulls_url":"https://api.github.com/repos/dain/slice/pulls{/number}","milestones_url":"https://api.github.com/repos/dain/slice/milestones{/number}","notifications_url":"https://api.github.com/repos/dain/slice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dain/slice/labels{/name}","releases_url":"https://api.github.com/repos/dain/slice/releases{/id}","deployments_url":"https://api.github.com/repos/dain/slice/deployments","created_at":"2013-06-14T06:46:59Z","updated_at":"2015-05-04T18:42:25Z","pushed_at":"2016-12-15T23:35:43Z","git_url":"git://github.com/dain/slice.git","ssh_url":"git@github.com:dain/slice.git","clone_url":"https://github.com/dain/slice.git","svn_url":"https://github.com/dain/slice","homepage":null,"size":336,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"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":"airlift:master","ref":"master","sha":"d4c7f14b5fb9f00cd5ab005fdcf789a83c568d6c","user":{"login":"airlift","id":1855389,"avatar_url":"https://avatars.githubusercontent.com/u/1855389?v=3","gravatar_id":"","url":"https://api.github.com/users/airlift","html_url":"https://github.com/airlift","followers_url":"https://api.github.com/users/airlift/followers","following_url":"https://api.github.com/users/airlift/following{/other_user}","gists_url":"https://api.github.com/users/airlift/gists{/gist_id}","starred_url":"https://api.github.com/users/airlift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airlift/subscriptions","organizations_url":"https://api.github.com/users/airlift/orgs","repos_url":"https://api.github.com/users/airlift/repos","events_url":"https://api.github.com/users/airlift/events{/privacy}","received_events_url":"https://api.github.com/users/airlift/received_events","type":"Organization","site_admin":false},"repo":{"id":9155612,"name":"slice","full_name":"airlift/slice","owner":{"login":"airlift","id":1855389,"avatar_url":"https://avatars.githubusercontent.com/u/1855389?v=3","gravatar_id":"","url":"https://api.github.com/users/airlift","html_url":"https://github.com/airlift","followers_url":"https://api.github.com/users/airlift/followers","following_url":"https://api.github.com/users/airlift/following{/other_user}","gists_url":"https://api.github.com/users/airlift/gists{/gist_id}","starred_url":"https://api.github.com/users/airlift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airlift/subscriptions","organizations_url":"https://api.github.com/users/airlift/orgs","repos_url":"https://api.github.com/users/airlift/repos","events_url":"https://api.github.com/users/airlift/events{/privacy}","received_events_url":"https://api.github.com/users/airlift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airlift/slice","description":"Java library for efficiently working with heap and off-heap memory","fork":false,"url":"https://api.github.com/repos/airlift/slice","forks_url":"https://api.github.com/repos/airlift/slice/forks","keys_url":"https://api.github.com/repos/airlift/slice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airlift/slice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airlift/slice/teams","hooks_url":"https://api.github.com/repos/airlift/slice/hooks","issue_events_url":"https://api.github.com/repos/airlift/slice/issues/events{/number}","events_url":"https://api.github.com/repos/airlift/slice/events","assignees_url":"https://api.github.com/repos/airlift/slice/assignees{/user}","branches_url":"https://api.github.com/repos/airlift/slice/branches{/branch}","tags_url":"https://api.github.com/repos/airlift/slice/tags","blobs_url":"https://api.github.com/repos/airlift/slice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airlift/slice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airlift/slice/git/refs{/sha}","trees_url":"https://api.github.com/repos/airlift/slice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airlift/slice/statuses/{sha}","languages_url":"https://api.github.com/repos/airlift/slice/languages","stargazers_url":"https://api.github.com/repos/airlift/slice/stargazers","contributors_url":"https://api.github.com/repos/airlift/slice/contributors","subscribers_url":"https://api.github.com/repos/airlift/slice/subscribers","subscription_url":"https://api.github.com/repos/airlift/slice/subscription","commits_url":"https://api.github.com/repos/airlift/slice/commits{/sha}","git_commits_url":"https://api.github.com/repos/airlift/slice/git/commits{/sha}","comments_url":"https://api.github.com/repos/airlift/slice/comments{/number}","issue_comment_url":"https://api.github.com/repos/airlift/slice/issues/comments{/number}","contents_url":"https://api.github.com/repos/airlift/slice/contents/{+path}","compare_url":"https://api.github.com/repos/airlift/slice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airlift/slice/merges","archive_url":"https://api.github.com/repos/airlift/slice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airlift/slice/downloads","issues_url":"https://api.github.com/repos/airlift/slice/issues{/number}","pulls_url":"https://api.github.com/repos/airlift/slice/pulls{/number}","milestones_url":"https://api.github.com/repos/airlift/slice/milestones{/number}","notifications_url":"https://api.github.com/repos/airlift/slice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airlift/slice/labels{/name}","releases_url":"https://api.github.com/repos/airlift/slice/releases{/id}","deployments_url":"https://api.github.com/repos/airlift/slice/deployments","created_at":"2013-04-01T20:39:10Z","updated_at":"2016-12-10T23:25:40Z","pushed_at":"2016-12-15T23:35:43Z","git_url":"git://github.com/airlift/slice.git","ssh_url":"git@github.com:airlift/slice.git","clone_url":"https://github.com/airlift/slice.git","svn_url":"https://github.com/airlift/slice","homepage":null,"size":497,"stargazers_count":213,"watchers_count":213,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":5,"forks":48,"open_issues":5,"watchers":213,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airlift/slice/pulls/72"},"html":{"href":"https://github.com/airlift/slice/pull/72"},"issue":{"href":"https://api.github.com/repos/airlift/slice/issues/72"},"comments":{"href":"https://api.github.com/repos/airlift/slice/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/airlift/slice/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/airlift/slice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airlift/slice/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/airlift/slice/statuses/038ace978e12932e996634756fd5cf6fa49459c4"}}}}
{"actor":{"display_login":"haozhun"}}