This commit is contained in:
AlgaLaptop
2026-01-02 20:52:44 +01:00
parent 2e0f44d28d
commit bceb70c052
31 changed files with 197 additions and 341 deletions
@@ -1,5 +1,4 @@
package fr.iutfbleau.sae.util;
import fr.iutfbleau.sae.util.BitOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -99,9 +98,14 @@ public class BitOutputStream {
if (fluxFerme) {
throw new IOException("Le flux de sortie est fermé");
}
while (this.positionBit >= 0) {
writeBit(0);
// Si l'octet nes pas vide on le complete avec des 0
if(this.positionBit < 7){
this.fluxSortie.write(this.octetEnConstruction);
this.octetEnConstruction = 0;
this.positionBit = 7;
}
this.fluxSortie.flush(); // Force l'écriture dans le flux sous-jacent dans le but de vider le buffer
}