Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 76294 invoked from network); 11 May 2006 13:22:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 May 2006 13:22:22 -0000 Received: (qmail 36527 invoked by uid 500); 11 May 2006 13:22:19 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 36488 invoked by uid 500); 11 May 2006 13:22:18 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 36477 invoked by uid 99); 11 May 2006 13:22:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2006 06:22:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [12.154.210.214] (HELO rectangular.com) (12.154.210.214) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2006 06:22:17 -0700 Received: from [67.189.26.9] (helo=[10.0.1.3]) by rectangular.com with esmtpa (Exim 4.44) id 1FeBCv-000E5m-Vc for java-dev@lucene.apache.org; Thu, 11 May 2006 06:27:58 -0700 Mime-Version: 1.0 (Apple Message framework v749.3) In-Reply-To: <318f0d5e0605110324q6c6f3465tffe9bd2ca1331bc4@mail.gmail.com> References: <318f0d5e0605110324q6c6f3465tffe9bd2ca1331bc4@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1A53E123-5131-4C09-A486-098E7AE3FC5D@rectangular.com> Content-Transfer-Encoding: 7bit From: Marvin Humphrey Subject: Re: VInt's as prefix. Was: bytecount as prefix Date: Thu, 11 May 2006 06:21:54 -0700 To: java-dev@lucene.apache.org X-Mailer: Apple Mail (2.749.3) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On May 11, 2006, at 3:24 AM, Ben van Klinken wrote: > Here is where the problem is, though: this > is not possible currently because we are using a VInt for the field > data length. What we really need is the ability to add "leading zeroes" to a VInt. I believe that this is possible if we change the definition of VInt so that the high bytes are written first, rather than the low bytes. The "BER compressed integer", used by Perl's pack() function, is defined this way. A proof-of-concept Perl script is below. Marvin Humphrey Rectangular Research http://www.rectangular.com/ #------------------------------------------------- #!/usr/bin/perl use strict; use warnings; my $pad = pack( 'C', 128 ); # "leading zero": 1000 0000 my $serialized = pack( 'wwawaaw', 127, 128, $pad, 129, $pad, $pad, 154 ); my @numbers = unpack( 'w*', $serialized ); print "@numbers\n"; # prints "127 128 129 154" --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org