only flush if there is something to flush
This commit is contained in:
parent
11c55185e8
commit
8f7a8dabc1
|
@ -34,7 +34,9 @@
|
||||||
<RunnerSettings RunnerId="Profile ">
|
<RunnerSettings RunnerId="Profile ">
|
||||||
<option name="myExternalizedOptions" value=" additional-options2=onexit\=snapshot " />
|
<option name="myExternalizedOptions" value=" additional-options2=onexit\=snapshot " />
|
||||||
</RunnerSettings>
|
</RunnerSettings>
|
||||||
|
<RunnerSettings RunnerId="Run" />
|
||||||
<ConfigurationWrapper RunnerId="Debug" />
|
<ConfigurationWrapper RunnerId="Debug" />
|
||||||
|
<ConfigurationWrapper RunnerId="Run" />
|
||||||
<method />
|
<method />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
|
@ -82,7 +82,9 @@ public class LZFOutputStream extends OutputStream {
|
||||||
* Compress and write the current block to the OutputStream
|
* Compress and write the current block to the OutputStream
|
||||||
*/
|
*/
|
||||||
private void writeCompressedBlock() throws IOException {
|
private void writeCompressedBlock() throws IOException {
|
||||||
encoder.encodeChunk(outputStream, outputBuffer, 0, position);
|
if (position > 0) {
|
||||||
position = 0;
|
encoder.encodeChunk(outputStream, outputBuffer, 0, position);
|
||||||
|
position = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,9 @@ public class LZFStreamOutput extends StreamOutput {
|
||||||
* Compress and write the current block to the OutputStream
|
* Compress and write the current block to the OutputStream
|
||||||
*/
|
*/
|
||||||
private void writeCompressedBlock() throws IOException {
|
private void writeCompressedBlock() throws IOException {
|
||||||
encoder.encodeChunk(out, outputBuffer, 0, position);
|
if (position > 0) {
|
||||||
position = 0;
|
encoder.encodeChunk(out, outputBuffer, 0, position);
|
||||||
|
position = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue