{"action":"created","comment":{"url":"https://api.github.com/repos/iphydf/tox4j/pulls/comments/32785753","id":32785753,"diff_hunk":"@@ -0,0 +1,99 @@\n+package im.tox.hlapi.storage\n+\n+import scala.collection.immutable.Iterable\n+\n+import java.nio.MappedByteBuffer\n+import java.nio.channels.FileChannel\n+import java.nio.channels.FileChannel.MapMode\n+import java.io.{ File, RandomAccessFile }\n+\n+object MappedFile {\n+  private val rw: String = \"rw\"\n+\n+  /** Create a MappedFile, given a path, and truncate to the specified length */\n+  def apply(path: String, size: Int): MappedFile = {\n+    val file2 = new RandomAccessFile(path, rw)\n+    file2.setLength(size * 1024)\n+    new MappedFile(file2.getChannel())\n+  }\n+\n+  /** Create a MappedFile from a path */\n+  def apply(path: String): MappedFile = {\n+    val file = new RandomAccessFile(path, rw)\n+    new MappedFile(file.getChannel())\n+  }\n+\n+  /**\n+   * Create a temporary MappedFile of a given length.\n+   *\n+   * The file is guaranteed to be unique,\n+   * and will be deleted when the JVM exits.\n+   */\n+  def tmp(size: Int): MappedFile = {\n+    val file = File.createTempFile(\"tox4j-FileLike\", size.toString)\n+    file.deleteOnExit()\n+    val file2 = new RandomAccessFile(file, rw)","path":"src/main/java/im/tox/hlapi/storage/MappedFile.scala","position":35,"original_position":35,"commit_id":"168abe955cb0ea87b44548e1101fdff7b07ec5db","original_commit_id":"168abe955cb0ea87b44548e1101fdff7b07ec5db","user":{"login":"klapku","id":12877059,"avatar_url":"https://avatars.githubusercontent.com/u/12877059?v=3","gravatar_id":"","url":"https://api.github.com/users/klapku","html_url":"https://github.com/klapku","followers_url":"https://api.github.com/users/klapku/followers","following_url":"https://api.github.com/users/klapku/following{/other_user}","gists_url":"https://api.github.com/users/klapku/gists{/gist_id}","starred_url":"https://api.github.com/users/klapku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klapku/subscriptions","organizations_url":"https://api.github.com/users/klapku/orgs","repos_url":"https://api.github.com/users/klapku/repos","events_url":"https://api.github.com/users/klapku/events{/privacy}","received_events_url":"https://api.github.com/users/klapku/received_events","type":"User","site_admin":false},"body":"Is it possible to find a more meaningful name for this variable?","created_at":"2015-06-18T22:29:01Z","updated_at":"2015-06-18T22:29:01Z","html_url":"https://github.com/iphydf/tox4j/pull/6#discussion_r32785753","pull_request_url":"https://api.github.com/repos/iphydf/tox4j/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/iphydf/tox4j/pulls/comments/32785753"},"html":{"href":"https://github.com/iphydf/tox4j/pull/6#discussion_r32785753"},"pull_request":{"href":"https://api.github.com/repos/iphydf/tox4j/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/iphydf/tox4j/pulls/6","id":37702437,"html_url":"https://github.com/iphydf/tox4j/pull/6","diff_url":"https://github.com/iphydf/tox4j/pull/6.diff","patch_url":"https://github.com/iphydf/tox4j/pull/6.patch","issue_url":"https://api.github.com/repos/iphydf/tox4j/issues/6","number":6,"state":"open","locked":false,"title":"HLAPI: Add FileLike component","user":{"login":"nbraud","id":1155801,"avatar_url":"https://avatars.githubusercontent.com/u/1155801?v=3","gravatar_id":"","url":"https://api.github.com/users/nbraud","html_url":"https://github.com/nbraud","followers_url":"https://api.github.com/users/nbraud/followers","following_url":"https://api.github.com/users/nbraud/following{/other_user}","gists_url":"https://api.github.com/users/nbraud/gists{/gist_id}","starred_url":"https://api.github.com/users/nbraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbraud/subscriptions","organizations_url":"https://api.github.com/users/nbraud/orgs","repos_url":"https://api.github.com/users/nbraud/repos","events_url":"https://api.github.com/users/nbraud/events{/privacy}","received_events_url":"https://api.github.com/users/nbraud/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-15T15:15:51Z","updated_at":"2015-06-18T22:29:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"125e95d42308653febad8e3bde2f45a278862e45","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iphydf/tox4j/pulls/6/commits","review_comments_url":"https://api.github.com/repos/iphydf/tox4j/pulls/6/comments","review_comment_url":"https://api.github.com/repos/iphydf/tox4j/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iphydf/tox4j/issues/6/comments","statuses_url":"https://api.github.com/repos/iphydf/tox4j/statuses/168abe955cb0ea87b44548e1101fdff7b07ec5db","head":{"label":"nbraud:FileLike","ref":"FileLike","sha":"168abe955cb0ea87b44548e1101fdff7b07ec5db","user":{"login":"nbraud","id":1155801,"avatar_url":"https://avatars.githubusercontent.com/u/1155801?v=3","gravatar_id":"","url":"https://api.github.com/users/nbraud","html_url":"https://github.com/nbraud","followers_url":"https://api.github.com/users/nbraud/followers","following_url":"https://api.github.com/users/nbraud/following{/other_user}","gists_url":"https://api.github.com/users/nbraud/gists{/gist_id}","starred_url":"https://api.github.com/users/nbraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbraud/subscriptions","organizations_url":"https://api.github.com/users/nbraud/orgs","repos_url":"https://api.github.com/users/nbraud/repos","events_url":"https://api.github.com/users/nbraud/events{/privacy}","received_events_url":"https://api.github.com/users/nbraud/received_events","type":"User","site_admin":false},"repo":{"id":35310249,"name":"tox4j","full_name":"nbraud/tox4j","owner":{"login":"nbraud","id":1155801,"avatar_url":"https://avatars.githubusercontent.com/u/1155801?v=3","gravatar_id":"","url":"https://api.github.com/users/nbraud","html_url":"https://github.com/nbraud","followers_url":"https://api.github.com/users/nbraud/followers","following_url":"https://api.github.com/users/nbraud/following{/other_user}","gists_url":"https://api.github.com/users/nbraud/gists{/gist_id}","starred_url":"https://api.github.com/users/nbraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbraud/subscriptions","organizations_url":"https://api.github.com/users/nbraud/orgs","repos_url":"https://api.github.com/users/nbraud/repos","events_url":"https://api.github.com/users/nbraud/events{/privacy}","received_events_url":"https://api.github.com/users/nbraud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nbraud/tox4j","description":"New and improved java wrapper for Tox","fork":true,"url":"https://api.github.com/repos/nbraud/tox4j","forks_url":"https://api.github.com/repos/nbraud/tox4j/forks","keys_url":"https://api.github.com/repos/nbraud/tox4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nbraud/tox4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nbraud/tox4j/teams","hooks_url":"https://api.github.com/repos/nbraud/tox4j/hooks","issue_events_url":"https://api.github.com/repos/nbraud/tox4j/issues/events{/number}","events_url":"https://api.github.com/repos/nbraud/tox4j/events","assignees_url":"https://api.github.com/repos/nbraud/tox4j/assignees{/user}","branches_url":"https://api.github.com/repos/nbraud/tox4j/branches{/branch}","tags_url":"https://api.github.com/repos/nbraud/tox4j/tags","blobs_url":"https://api.github.com/repos/nbraud/tox4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nbraud/tox4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nbraud/tox4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/nbraud/tox4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nbraud/tox4j/statuses/{sha}","languages_url":"https://api.github.com/repos/nbraud/tox4j/languages","stargazers_url":"https://api.github.com/repos/nbraud/tox4j/stargazers","contributors_url":"https://api.github.com/repos/nbraud/tox4j/contributors","subscribers_url":"https://api.github.com/repos/nbraud/tox4j/subscribers","subscription_url":"https://api.github.com/repos/nbraud/tox4j/subscription","commits_url":"https://api.github.com/repos/nbraud/tox4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/nbraud/tox4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/nbraud/tox4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/nbraud/tox4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/nbraud/tox4j/contents/{+path}","compare_url":"https://api.github.com/repos/nbraud/tox4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nbraud/tox4j/merges","archive_url":"https://api.github.com/repos/nbraud/tox4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nbraud/tox4j/downloads","issues_url":"https://api.github.com/repos/nbraud/tox4j/issues{/number}","pulls_url":"https://api.github.com/repos/nbraud/tox4j/pulls{/number}","milestones_url":"https://api.github.com/repos/nbraud/tox4j/milestones{/number}","notifications_url":"https://api.github.com/repos/nbraud/tox4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nbraud/tox4j/labels{/name}","releases_url":"https://api.github.com/repos/nbraud/tox4j/releases{/id}","created_at":"2015-05-09T01:40:39Z","updated_at":"2015-06-06T14:20:20Z","pushed_at":"2015-06-17T18:38:52Z","git_url":"git://github.com/nbraud/tox4j.git","ssh_url":"git@github.com:nbraud/tox4j.git","clone_url":"https://github.com/nbraud/tox4j.git","svn_url":"https://github.com/nbraud/tox4j","homepage":null,"size":2267,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"hlapi"}},"base":{"label":"iphydf:auto","ref":"auto","sha":"64c9011e77f052e7f2104783830424155d905478","user":{"login":"iphydf","id":10647936,"avatar_url":"https://avatars.githubusercontent.com/u/10647936?v=3","gravatar_id":"","url":"https://api.github.com/users/iphydf","html_url":"https://github.com/iphydf","followers_url":"https://api.github.com/users/iphydf/followers","following_url":"https://api.github.com/users/iphydf/following{/other_user}","gists_url":"https://api.github.com/users/iphydf/gists{/gist_id}","starred_url":"https://api.github.com/users/iphydf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iphydf/subscriptions","organizations_url":"https://api.github.com/users/iphydf/orgs","repos_url":"https://api.github.com/users/iphydf/repos","events_url":"https://api.github.com/users/iphydf/events{/privacy}","received_events_url":"https://api.github.com/users/iphydf/received_events","type":"User","site_admin":false},"repo":{"id":32993709,"name":"tox4j","full_name":"iphydf/tox4j","owner":{"login":"iphydf","id":10647936,"avatar_url":"https://avatars.githubusercontent.com/u/10647936?v=3","gravatar_id":"","url":"https://api.github.com/users/iphydf","html_url":"https://github.com/iphydf","followers_url":"https://api.github.com/users/iphydf/followers","following_url":"https://api.github.com/users/iphydf/following{/other_user}","gists_url":"https://api.github.com/users/iphydf/gists{/gist_id}","starred_url":"https://api.github.com/users/iphydf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iphydf/subscriptions","organizations_url":"https://api.github.com/users/iphydf/orgs","repos_url":"https://api.github.com/users/iphydf/repos","events_url":"https://api.github.com/users/iphydf/events{/privacy}","received_events_url":"https://api.github.com/users/iphydf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iphydf/tox4j","description":"New and improved java wrapper for Tox","fork":true,"url":"https://api.github.com/repos/iphydf/tox4j","forks_url":"https://api.github.com/repos/iphydf/tox4j/forks","keys_url":"https://api.github.com/repos/iphydf/tox4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iphydf/tox4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iphydf/tox4j/teams","hooks_url":"https://api.github.com/repos/iphydf/tox4j/hooks","issue_events_url":"https://api.github.com/repos/iphydf/tox4j/issues/events{/number}","events_url":"https://api.github.com/repos/iphydf/tox4j/events","assignees_url":"https://api.github.com/repos/iphydf/tox4j/assignees{/user}","branches_url":"https://api.github.com/repos/iphydf/tox4j/branches{/branch}","tags_url":"https://api.github.com/repos/iphydf/tox4j/tags","blobs_url":"https://api.github.com/repos/iphydf/tox4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iphydf/tox4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iphydf/tox4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/iphydf/tox4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iphydf/tox4j/statuses/{sha}","languages_url":"https://api.github.com/repos/iphydf/tox4j/languages","stargazers_url":"https://api.github.com/repos/iphydf/tox4j/stargazers","contributors_url":"https://api.github.com/repos/iphydf/tox4j/contributors","subscribers_url":"https://api.github.com/repos/iphydf/tox4j/subscribers","subscription_url":"https://api.github.com/repos/iphydf/tox4j/subscription","commits_url":"https://api.github.com/repos/iphydf/tox4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/iphydf/tox4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/iphydf/tox4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/iphydf/tox4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/iphydf/tox4j/contents/{+path}","compare_url":"https://api.github.com/repos/iphydf/tox4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iphydf/tox4j/merges","archive_url":"https://api.github.com/repos/iphydf/tox4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iphydf/tox4j/downloads","issues_url":"https://api.github.com/repos/iphydf/tox4j/issues{/number}","pulls_url":"https://api.github.com/repos/iphydf/tox4j/pulls{/number}","milestones_url":"https://api.github.com/repos/iphydf/tox4j/milestones{/number}","notifications_url":"https://api.github.com/repos/iphydf/tox4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iphydf/tox4j/labels{/name}","releases_url":"https://api.github.com/repos/iphydf/tox4j/releases{/id}","created_at":"2015-03-27T15:26:33Z","updated_at":"2015-06-06T19:17:42Z","pushed_at":"2015-06-18T21:28:20Z","git_url":"git://github.com/iphydf/tox4j.git","ssh_url":"git@github.com:iphydf/tox4j.git","clone_url":"https://github.com/iphydf/tox4j.git","svn_url":"https://github.com/iphydf/tox4j","homepage":null,"size":3372,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"auto"}},"_links":{"self":{"href":"https://api.github.com/repos/iphydf/tox4j/pulls/6"},"html":{"href":"https://github.com/iphydf/tox4j/pull/6"},"issue":{"href":"https://api.github.com/repos/iphydf/tox4j/issues/6"},"comments":{"href":"https://api.github.com/repos/iphydf/tox4j/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/iphydf/tox4j/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/iphydf/tox4j/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iphydf/tox4j/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/iphydf/tox4j/statuses/168abe955cb0ea87b44548e1101fdff7b07ec5db"}}}}