Skip to content
Snippets Groups Projects
Commit ee3559d9 authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Added utility method to InBitStream

parent 0831b322
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ import java.io.IOException; ...@@ -10,7 +10,7 @@ import java.io.IOException;
public class DataCompressor { public class DataCompressor {
public static void main(String[] args) throws IOException { public static void main(String[] args) {
Options options = getOptions(); Options options = getOptions();
HelpFormatter formatter = new HelpFormatter(); HelpFormatter formatter = new HelpFormatter();
...@@ -33,7 +33,7 @@ public class DataCompressor { ...@@ -33,7 +33,7 @@ public class DataCompressor {
return; return;
} }
// System.out.println(parsedCliOptions.report()); // System.out.println(parsedCliOptions.report());
switch (parsedCliOptions.getMethod()) { switch (parsedCliOptions.getMethod()) {
......
...@@ -62,11 +62,18 @@ public class InBitStream { ...@@ -62,11 +62,18 @@ public class InBitStream {
//writing => bit = (value & (1 << shift)); //writing => bit = (value & (1 << shift));
for (int shift = 0; shift < bitsPerValue; shift++) { for (int shift = 0; shift < bitsPerValue; shift++) {
bit = readBit(); bit = readBit();
// FIXME
result |= (bit << shift); result |= (bit << shift);
} }
return result; return result;
} }
public int[] readNValues(final int n) throws IOException {
int[] values = new int[n];
for (int i = 0; i < n; i++) {
values[i] = readValue();
}
return values;
}
/**/ /**/
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment