Package com.graphhopper.storage
Class VLongStorage
java.lang.Object
com.graphhopper.storage.VLongStorage
Taken from Lucene DataOutput. VLong's are longs which have variable length depending on the size.
When used together with 'delta compression' it is likely that you'll use only 1 byte per value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
long
long
long
Reads a long stored in variable-length format.void
seek
(long pos) void
final void
writeVLong
(long i) Writes an long in a variable-length format.
-
Constructor Details
-
VLongStorage
public VLongStorage() -
VLongStorage
public VLongStorage(int cap) -
VLongStorage
public VLongStorage(byte[] bytes)
-
-
Method Details
-
seek
public void seek(long pos) -
getPosition
public long getPosition() -
getLength
public long getLength() -
writeVLong
public final void writeVLong(long i) Writes an long in a variable-length format. Writes between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.The format is described further in Lucene its DataOutput#writeVInt(int)
See DataInput readVLong of Lucene
-
readVLong
public long readVLong()Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.The format is described further in DataOutput writeVInt(int) from Lucene.
-
trimToSize
public void trimToSize() -
getBytes
public byte[] getBytes()
-