deephacks / lmdbjni

LMDB for Java
Apache License 2.0
204 stars 28 forks source link

Adding methods for using shorts with BufferCursor #57

Closed slaunay closed 8 years ago

slaunay commented 8 years ago

It's not possible to read or write short values using the BufferCursor.

Current workaround is to use *WriteByte[s] methods:

 cursor.keyWriteBytes(new byte[] {0, 1});
 cursor.valWriteByte((shortValue >> 8) & 0xff);
 cursor.valWriteByte(shortValue & 0xff);

Code change: