Writing/Reading Bits

From: Alex Power (powera_at_iastate.edu)
Date: 01/27/04


Date: Tue, 27 Jan 2004 12:05:23 -0600

Hi --

I am working on a project that needs to write data to a file in a specific
pattern. I have two arguments: a number from 0-15, and a long. I need to
write the first number in 4 bits, and then the last 20 bits of the long
(the first bits should be zero, but not necessarily). I also need to be
able to read these 3-bit sets. InputStream and OutputStream only read
bytes, and I cannot convert it to a BitSet. Memory space is important, so
simply writing the full long is not an option.

Alex Power



Relevant Pages

  • Re: Writing/Reading Bits
    ... Alex Power wrote: ... > Memory space is important, so simply writing the full long is not an ... Mask your data into 3 bytes and write it. ...
    (comp.lang.java.help)
  • Re: Exchange 2003 Transaction Log Performance
    ... Instead of one thread writing, ... The IO pattern will ... The seek time is the major component of disk access time. ... order to achieve a purely sequential workload, you'd need to be able to ...
    (microsoft.public.exchange.design)
  • Re: Uses of Magic
    ... see a pattern. ... likely--that you think it is a flaw in the character. ... Spending one's talents in a profitable endeavor that does ... honestly claim that doing so is my main reason for writing them. ...
    (rec.arts.sf.composition)
  • Re: Regular expression for numeric
    ... "v1.2.54" it is not fixed, meaning, my code needs to dynamically picks ... version which will always be like this pattern: ... Programming Language" and study it carefully. ... tutorial around, but the writing is not verbose, and you have to pay ...
    (comp.lang.c)
  • Re: Python Patterns
    ... > methods (embodied in the one strategy object) commuted as a whole. ... has a different interface than with the State pattern. ... is essentially identical to the internal state object -- which, ... Don't know why I'm writing all this. ...
    (comp.lang.python)