comp.lang.ada
 help / color / mirror / Atom feed
From: kilgallen@eisner.decus.org (Larry Kilgallen)
Subject: Re: Help!! Writing binary bit by bit
Date: 1997/04/16
Date: 1997-04-16T00:00:00+00:00	[thread overview]
Message-ID: <1997Apr16.075241.1@eisner> (raw)
In-Reply-To: 5j0vh0$2d1$3@cathedral.cerc.wvu.edu


In article <5j0vh0$2d1$3@cathedral.cerc.wvu.edu>, mcgreal@cs.wvu.edu (Martin McGreal) writes:
> I'm trying to write a program that converts normal binary or ascii files into
> Huffman code. I was going to use indexed_io's procedure read_by_key to
> allocate the amount of bits used, but it turns out you can only allocate 
> BYTES with that procedure (i'm fairly certain, call me on that if you can).
> 
> Is there any sort of IO that i'm not familiar with that gives the programmer 
> control over how many bits are written, and exactly what bits those are 
> (0's or 1's)? That is the only way I see to translate without having an IO 
> package translate for me.
> 
> If I wanted to write 001101, and that's all, not the binary equvalent for
> each digit. If I wanted to write one binary digit at a time, is it possible,
> or is there a more appropriate place to find out?

In DEC Ada on VMS (my presumption -- your newswriter seems to be having
hiccups today) generic package INDEXED_IO is layered on top of the Record
Management System (RMS) provided by VMS.  RMS has a minimum granularity in
record size of 1 byte.

You will need some higher level mechanism to indicate how many of those
bits are actually meaningful.  I would suggest the ASN.1 encoding of BIT
STRING.  Then again, I am becoming an ASN.1 bigot in addition to a VMS
bigot, an Ada bigot (and for that matter, an RMS bigot).

Of course if you wanted some particular _ordering_ out of the resultant
keys (as distinguished from direct lookup) BIT STRING would be a bad
choice.

Larry Kilgallen




  parent reply	other threads:[~1997-04-16  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5j0vh0$2d1$3@cathedral.cerc.wvu.edu>
1997-04-16  0:00 ` Help!! Writing binary bit by bit Gautier
1997-04-16  0:00 ` Larry Kilgallen [this message]
1997-04-18  0:00 ` Robert Dewar
1997-04-21  0:00   ` Michael F Brenner
1997-04-23  0:00     ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox