{"action":"created","issue":{"url":"https://api.github.com/repos/RuedigerMoeller/fast-serialization/issues/78","labels_url":"https://api.github.com/repos/RuedigerMoeller/fast-serialization/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/RuedigerMoeller/fast-serialization/issues/78/comments","events_url":"https://api.github.com/repos/RuedigerMoeller/fast-serialization/issues/78/events","html_url":"https://github.com/RuedigerMoeller/fast-serialization/issues/78","id":94870616,"number":78,"title":"java.lang.NegativeArraySizeException","user":{"login":"haochun","id":9320176,"avatar_url":"https://avatars.githubusercontent.com/u/9320176?v=3","gravatar_id":"","url":"https://api.github.com/users/haochun","html_url":"https://github.com/haochun","followers_url":"https://api.github.com/users/haochun/followers","following_url":"https://api.github.com/users/haochun/following{/other_user}","gists_url":"https://api.github.com/users/haochun/gists{/gist_id}","starred_url":"https://api.github.com/users/haochun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haochun/subscriptions","organizations_url":"https://api.github.com/users/haochun/orgs","repos_url":"https://api.github.com/users/haochun/repos","events_url":"https://api.github.com/users/haochun/events{/privacy}","received_events_url":"https://api.github.com/users/haochun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-14T05:24:33Z","updated_at":"2015-07-14T11:48:38Z","closed_at":null,"body":"java.lang.NegativeArraySizeException\r\n\tat java.util.Arrays.copyOf(Arrays.java:2271)\r\n\tat org.nustaq.serialization.util.FSTOutputStream.grow(FSTOutputStream.java:92)\r\n\tat org.nustaq.serialization.util.FSTOutputStream.ensureFree(FSTOutputStream.java:71)\r\n\tat org.nustaq.serialization.coders.FSTStreamEncoder.writeStringUTF(FSTStreamEncoder.java:302)\r\n\tat org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:392)\r\n\tat org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:319)\r\n\tat org.nustaq.serialization.serializers.FSTMapSerializer.writeObject(FSTMapSerializer.java:48)\r\n\tat org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:455)\r\n\tat org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:319)\r\n\tat org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:284)\r\n\tat org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:193)\r\n\t...\r\nwhen i use fst to  serialize HashMap<String,String>.i guess because the size of map is to big,"},"comment":{"url":"https://api.github.com/repos/RuedigerMoeller/fast-serialization/issues/comments/121213167","html_url":"https://github.com/RuedigerMoeller/fast-serialization/issues/78#issuecomment-121213167","issue_url":"https://api.github.com/repos/RuedigerMoeller/fast-serialization/issues/78","id":121213167,"user":{"login":"RuedigerMoeller","id":6097932,"avatar_url":"https://avatars.githubusercontent.com/u/6097932?v=3","gravatar_id":"","url":"https://api.github.com/users/RuedigerMoeller","html_url":"https://github.com/RuedigerMoeller","followers_url":"https://api.github.com/users/RuedigerMoeller/followers","following_url":"https://api.github.com/users/RuedigerMoeller/following{/other_user}","gists_url":"https://api.github.com/users/RuedigerMoeller/gists{/gist_id}","starred_url":"https://api.github.com/users/RuedigerMoeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RuedigerMoeller/subscriptions","organizations_url":"https://api.github.com/users/RuedigerMoeller/orgs","repos_url":"https://api.github.com/users/RuedigerMoeller/repos","events_url":"https://api.github.com/users/RuedigerMoeller/events{/privacy}","received_events_url":"https://api.github.com/users/RuedigerMoeller/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T11:48:38Z","updated_at":"2015-07-14T11:48:38Z","body":"It's caused by int index limit, cannot fix that. You might try to split up the graph like:\r\n```\r\nmyHugeMap.entrySet().forEach( entry -> {\r\n\r\n     byte key[] = fstConf.asByteArray( entry.key() );\r\n     byte value[] = fstConf.asByteArray( entry.value() );\r\n\r\n     fileOutputStream.writeInt( key.length ); \r\n     fileOutputStream.write( key ); \r\n\r\n     fileOutputStream.writeInt( value.length ); \r\n     fileOutputStream.write( value ); \r\n\r\n});\r\n```\r\n"}}