Package totalcross.json.zip
Interface BitWriter
-
- All Known Implementing Classes:
BitOutputStream
public interface BitWriterA bitwriter is a an interface that allows for doing output at the bit level. Most IO interfaces only allow for writing at the byte level or higher.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidone()Write a 1 bit.voidpad(int width)Pad the rest of the block with zeros and flush.voidwrite(int bits, int width)Write some bits.voidzero()Write a 0 bit.
-
-
-
Method Detail
-
one
void one() throws IOException
Write a 1 bit.- Throws:
IOException
-
pad
void pad(int width) throws IOException
Pad the rest of the block with zeros and flush.- Parameters:
width- The size in bits of the block to pad. This will typically be 8, 16, 32, 64, 128, 256, etc.- Throws:
IOException
-
write
void write(int bits, int width) throws IOExceptionWrite some bits. Up to 32 bits can be written at a time.- Parameters:
bits- The bits to be written.width- The number of bits to write. (0..32)- Throws:
IOException
-
zero
void zero() throws IOException
Write a 0 bit.- Throws:
IOException
-
-