{"action":"opened","issue":{"url":"https://api.github.com/repos/lemire/JavaFastPFOR/issues/36","repository_url":"https://api.github.com/repos/lemire/JavaFastPFOR","labels_url":"https://api.github.com/repos/lemire/JavaFastPFOR/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/lemire/JavaFastPFOR/issues/36/comments","events_url":"https://api.github.com/repos/lemire/JavaFastPFOR/issues/36/events","html_url":"https://github.com/lemire/JavaFastPFOR/issues/36","id":181603019,"number":36,"title":"getting IndexOutOfBoundsException during compression","user":{"login":"pilaszyistvan","id":10132363,"avatar_url":"https://avatars.githubusercontent.com/u/10132363?v=3","gravatar_id":"","url":"https://api.github.com/users/pilaszyistvan","html_url":"https://github.com/pilaszyistvan","followers_url":"https://api.github.com/users/pilaszyistvan/followers","following_url":"https://api.github.com/users/pilaszyistvan/following{/other_user}","gists_url":"https://api.github.com/users/pilaszyistvan/gists{/gist_id}","starred_url":"https://api.github.com/users/pilaszyistvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pilaszyistvan/subscriptions","organizations_url":"https://api.github.com/users/pilaszyistvan/orgs","repos_url":"https://api.github.com/users/pilaszyistvan/repos","events_url":"https://api.github.com/users/pilaszyistvan/events{/privacy}","received_events_url":"https://api.github.com/users/pilaszyistvan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-07T07:37:18Z","updated_at":"2016-10-07T07:37:18Z","closed_at":null,"body":"I have the following code:\r\n```\r\nimport java.nio.file.*;\r\nimport java.util.stream.Stream;\r\nimport me.lemire.integercompression.differential.IntegratedIntCompressor;\r\npublic class Proba {\r\n        public static void main(String[] args) throws Exception {\r\n                int[] data = Files.lines(Paths.get(\"integers.txt\")).mapToInt(Integer::parseInt).toArray();\r\n                System.out.println(\"Read \" + data.length + \" integers\");\r\n                IntegratedIntCompressor iic = new IntegratedIntCompressor();\r\n                int[] compressed = iic.compress(data);\r\n        }\r\n}\r\n```\r\nI run the following command:\r\njava -cp .:JavaFastPFOR-0.1.9.jar Proba\r\n\r\nAnd I get the following output:\r\n```\r\nRead 130657 integers\r\nException in thread \"main\" java.lang.IndexOutOfBoundsException\r\n        at java.nio.Buffer.checkBounds(Buffer.java:567)\r\n        at java.nio.DirectIntBufferU.get(DirectIntBufferU.java:265)\r\n        at me.lemire.integercompression.differential.IntegratedVariableByte.headlessCompress(IntegratedVariableByte.java:222)\r\n        at me.lemire.integercompression.differential.SkippableIntegratedComposition.headlessCompress(SkippableIntegratedComposition.java:58)\r\n        at me.lemire.integercompression.differential.IntegratedIntCompressor.compress(IntegratedIntCompressor.java:42)\r\n        at Proba.main(Proba.java:9)\r\n```\r\n\r\nOutput of 'java -version':\r\njava version \"1.8.0_91\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_91-b14)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)\r\n\r\nPlease find attached the 'integers.txt' containing the integer numbers. I tried to make it smaller, the original array contained 1 million elements, now it contains \"only\" 130657 integers, but I cannot reduce its size further.\r\n\r\n\r\n[integers.txt](https://github.com/lemire/JavaFastPFOR/files/515521/integers.txt)\r\n"}}
{"actor":{"display_login":"pilaszyistvan"}}