[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: Question about readVint & writeVint from DataOutput and DataInput
From:       Aaron Cohen <aaronmichaelcohen () me ! com ! INVALID>
Date:       2021-09-03 14:54:22
Message-ID: E120F1A2-AAF9-460E-9A98-A2176A32BDB8 () me ! com
[Download RAW message or body]

Thank you for the clarification.

> On Sep 3, 2021, at 10:46 AM, Uwe Schindler <uwe@thetaphi.de> wrote:
> 
> They are fully supported, so you can write and read them.
> 
> The problem with negative numbers is that they need lot of (disk) space, because in \
> two's complement they have almost all bits set. The largest number is kinds of disk \
> space is -1. 
> Negative numbers appear in older index formats, so they can't be prevented by a \
> pull request as suggested. 
> Just take the comment as given: all is supported, but if you want to store negative \
> numbers use a different encoding, e.g. zigzag. 
> Uwe
> 
> Am 3. September 2021 14:34:35 UTC schrieb Aaron Cohen \
> <aaronmichaelcohen@me.com.INVALID>:
> > While reading the Lucene JavaDoc I came across writeVInt \
> > <https://lucene.apache.org/core/8_9_0/core/org/apache/lucene/store/DataOutput.html#writeVInt-int-> \
> > & readVInt <https://lucene.apache.org/core/8_9_0/core/org/apache/lucene/store/DataInput.html#readVInt--> \
> > from DataOutput and DataInput base classes. It says for writeVint 
> > Parameters:
> > i - Smaller values take fewer bytes. Negative numbers are supported, but should \
> > be avoided. 
> > And for readVint "Negative numbers are supported, but should be avoided."
> > 
> > This seems like an odd statement. Why would something be supported but should be \
> > avoided? Should I submit a PR to prevent negative integers?
> --
> Uwe Schindler
> Achterdiek 19, 28357 Bremen
> https://www.thetaphi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic