Sakuraqwq1/moonmp3-encoder/src/bits does not have a README file

    BitWriter

    pub struct BitWriter {
    buffer :
    Buffer

    current : Int
    filled : Int
    }

    MSB-first bit writer. An MP3 frame's side information and main data form a continuous bit stream, so every field (including the ones that are not byte aligned) goes through here. Bits accumulate MSB-first into bytes, matching the bit order the Layer III spec requires.

    BitWriter::align

    fn BitWriter::align(self : BitWriter) -> Unit

    Pad with zero bits until the stream is byte aligned.

    BitWriter::bit_length

    fn BitWriter::bit_length(self : BitWriter) -> Int

    Number of bits written so far.

    BitWriter::finish

    fn BitWriter::finish(self : BitWriter) -> Bytes

    Finish the stream and return the bytes written. The writer is unusable afterwards; make a new one for the next frame.

    BitWriter::new

    fn BitWriter::new() -> BitWriter

    A fresh writer with an empty buffer.

    BitWriter::write_bit

    fn BitWriter::write_bit(self : BitWriter, bit : Int) -> Unit

    Append a single bit.

    BitWriter::write_bits

    fn BitWriter::write_bits(self : BitWriter, value : Int64, count : Int) -> Unit

    Append the low count bits of value, most significant first.

    Source Files

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io