Actually I broke BlockEncoder, but now it works.
parent
a8b8e92187
commit
84cc3fdbfc
|
@ -263,6 +263,17 @@ public class BZip2OutputStream extends OutputStream
|
|||
return this == o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the stream if the client has been sloppy about it.
|
||||
*/
|
||||
@Override
|
||||
protected void finalize() throws Throwable
|
||||
{
|
||||
close();
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a {@link BZip2EncoderExecutorService} that can be shared between
|
||||
* several {@link BZip2OutputStream}:s to spread the bzip2 encoding work
|
||||
|
|
|
@ -179,9 +179,9 @@ final class BlockEncoder
|
|||
{
|
||||
byte[] res = m_scratchpad.m_sequenceMap;
|
||||
byte index = 0;
|
||||
for (int i : symbols)
|
||||
for (byte i : symbols)
|
||||
{
|
||||
res[symbols[i] & 0xFF] = index++;
|
||||
res[i & 0xFF] = index++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ final class BlockEncoder
|
|||
private void writeBlockHeader(final int blockChecksum, int bwFirstPointer, boolean[] seenDifferentBytes, MTFAndRLEResult mtfrle, HuffmanTreesAndUsage htau) throws IOException
|
||||
{
|
||||
// Block magic
|
||||
for (int b : BLOCK_MAGIC) {
|
||||
for (byte b : BLOCK_MAGIC) {
|
||||
m_out.writeBitsLittleEndian(b & 0xFF, 8);
|
||||
}
|
||||
// Checksum
|
||||
|
|
|
@ -307,7 +307,7 @@ final class BlockOutputStream extends OutputStream
|
|||
@Override
|
||||
public void write(final byte[] data) throws IOException
|
||||
{
|
||||
for (int datum : data) {
|
||||
for (byte datum : data) {
|
||||
write(datum & 0xFF);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue