Compressed storage of integer numbers.

From: [at]} <Wojtek>
Date: Thu, 25 Feb 1999 18:16:22 -0800

Hi:

  for some time I kept wondering why reading/writing integers
in compressed form has been dropped from BlackBox. Remember
those wonderful procedures Files.ReadNum and Files.WriteNum?
They can store small integer numbers on fewer bytes than 4.


In my applications I am dealing with arrays of integers that are strongly
correlated, in the sense that differences between consequtive numbers
are much smaller than the numbers themselves. I thus developed the
following module, and I have used it a lot.

Comments welcome.

Wojtek


StdCoder.Decode ..,, ..YM0...3Qw7uP5PRPPNR9Rbf9b8R79FTvMf1GomCrlAy2xhX,Cb2x
 hXhC6FU1xhiZiVBhihgmRiioedhgrZcZRiXFfaqmSrtuGfa4700zdGrr8rmCLLCJuyKtYcZRiX
 7.2.s,Me9,0k,5TWyql.bnayKmKKqGomC5XzET1.PuP.MHT9N9ntumaU2,CJuyKtQC98P9PP7O
 NbXmb.2.wyYk2krH0,6.cUGpmWLuOpoKqvCbHZiYpedhA704TeKKw.bHfEWUmL.6..D.nA76.C
 cIhgsNHT9N9ntQ8qorG4704D.CbB,708T1U.kF90T.rg62.,.ND,cU.ktAcoZimBhWhiohgnZc
 ZRCY.2.w22U.EBU.U,U.I3tfj1.0E65.g0AU0KyBU.2.e22.e,2.AU.Ue.4.072Uu.9.1sAE1k
.Kn.kek.i3Y.IU0KyBU.2.850E.c4E.k.0.e06.2UwK.s0k1E,m.0E6k.e1w.AU2V.g.IU4.,,
 3.w2IU2U.o,IU1U.o0QU0KyBU.2.02,.e,0E.k.0.eWM2y,.,6YU02.A4QU0.Z,5.0E3E08Mtr
.0E.6n6.c46.,Uz1,c8m5E.m9M00.H,5.Q3Q.E2k,.F,5.A1.o5Q.6.B.5.0ERk,U.w,.I4Q.6
.k,U.I,YU8U.g2.Q3.w..22Q.k6k08Mtr.0E.6d6.c4E.k.Ue.8.0t.U32.Q1.0k6k,.B.5.0E
 66.9M,E8k,.Z.1sA6.D.1c71.HE.AUiV.o,YULU.Q3AUvU.2,AU6V.wPIUBU.2M0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Ib.91pVWUY,6J.Y7.10iXB66F,5
 0C5R1ME..R76ZONEEEEa4kr..w7.508pm.I3O423.8pU8bVtC,,G5F,..,VBEfkoMG..kYcNkS
.d0EEYCe1RWvUI,gcA,0WCFI.cNcLa022B0Uk.N0.,,.22dnhERcN66rWB.90MFR0gAUW.666J
.Q6TXG,kRqU0hc5,,NNIbxIYWQbU.pNDBOENuIgcCFgaqk.bf9PM1PcUXDJ9X1xhiZimxhgZhZ
 JinpZHZC58RZ9P7ONbvM,Mw2D.UiQcjpho,YcZRiX3.5uPAgdFt.85...CLL.U2V.IS2U.UIU.
 U76.,6.,..1cUXDJcIf9P9fQbf9bWGhigFWE.4Te.sQRdIf9P9HWE.8z,E.0.LJ.w.0kF3.,6.
 CcI7S.bf9bWHZitZhZZcZRC,Mw.ELMSN12Umz.,U..2,I9,U.E,5D.oZ,ZCIA6FQg.6,6..UYU
.AU.6.0.0nMfZ.E.SoA5UTyB,M.M.6.,U0KyB6.2..c4E.k.Ue2U5Bn,6.,E.0t.U..61lbAUw
 ApPt0lLU8ssH2f1dvQRtET1.UE2.0..606.k22.0TAPbUKjN8Utj00MyfUkZnf76xfX0.n70..
.
 --- end of encoding ---
Received on Fri Feb 26 1999 - 03:30:29 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:42 UTC