You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm loading up a tr13 into a byte buffer then attempting to use it from a memory mapped byte buffer and getting errors attempting to lookup values I put in the tr13. It isn't even very large yet. It appears to be attempting to pull up a value which is much larger than the generated file itself.
Here is the exception:
Exception in thread "main" java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:532)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253)
at com.ning.tr13.util.VInt.bytesToUnsigned(VInt.java:165)
at com.ning.tr13.impl.bytes.ByteBufferBytesTrieLookup._findValue(ByteBufferBytesTrieLookup.java:81)
at com.ning.tr13.impl.bytes.ByteBufferBytesTrieLookup.findValue(ByteBufferBytesTrieLookup.java:36)
at MemoryMappedLookup.testString(MemoryMappedLookup.java:174)
Any thoughts it I'm somehow causing this? There is quite a lot of code to try and post a small sample. I will try and cook up something if this doesn't ring any bells with anybody.
The text was updated successfully, but these errors were encountered:
I have more to report. I was passing true to the second argument of SimpleBytesTrieBuilder.buildAndWrite. I think I started passing true after reading the code and comments therein. Regardless, wonderful library! Ten out of ten would stumble through the issue again!
Hi there! Awesome that you were able to figure out the problem. Library is (alas!) not well documented yet, so it is not surprising you got bit by this. If you have suggestions for simple updates to README I would love to incorporate those. Same for javadocs etc as well of course.
I am also curious as to kind of usage you have, if you can share.
I'm loading up a tr13 into a byte buffer then attempting to use it from a memory mapped byte buffer and getting errors attempting to lookup values I put in the tr13. It isn't even very large yet. It appears to be attempting to pull up a value which is much larger than the generated file itself.
Here is the exception:
Exception in thread "main" java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:532)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253)
at com.ning.tr13.util.VInt.bytesToUnsigned(VInt.java:165)
at com.ning.tr13.impl.bytes.ByteBufferBytesTrieLookup._findValue(ByteBufferBytesTrieLookup.java:81)
at com.ning.tr13.impl.bytes.ByteBufferBytesTrieLookup.findValue(ByteBufferBytesTrieLookup.java:36)
at MemoryMappedLookup.testString(MemoryMappedLookup.java:174)
Any thoughts it I'm somehow causing this? There is quite a lot of code to try and post a small sample. I will try and cook up something if this doesn't ring any bells with anybody.
The text was updated successfully, but these errors were encountered: