Documente Academic
Documente Profesional
Documente Cultură
byte[] compAOB;
ByteArrayOutputStream byteArrOutStream;
double invalidOut;
double T;
int byteLenOfCompAOB;
int i;
OutputStream outStream;
String errorMsg;
String SWithSpace;
char[] SWithSpaceChar;
StringWriter error;
outStream.write(SWithSpace.getBytes());
}
finally
{
outStream.close();
}
compAOB = byteArrOutStream.toByteArray();;
byteLenOfCompAOB = compAOB.length;
T = (double) (byteLenOfCompAOB);
executor.shutdown();
return (T);
}
catch (IOException e)
{
error = new StringWriter();
e.printStackTrace(new PrintWriter(error));
errorMsg = "Compression Test Statistics tidak dapat diimplementasi
karena adanya eror berikut :\n" + error.toString();
System.out.println(errorMsg);
invalidOut = -1d;
executor.shutdown();
return (invalidOut);
}
finally
{
executor.shutdown();
}
}
else
{
try
{
outStream = new BZip2OutputStream(byteArrOutStream);
try
{
outStream.write(SWithSpace.getBytes());
}
finally
{
outStream.close();
}
compAOB = byteArrOutStream.toByteArray();
byteLenOfCompAOB = compAOB.length;
T = (double) (byteLenOfCompAOB);
return (T);
}
catch (IOException e)
{
error = new StringWriter();
e.printStackTrace(new PrintWriter(error));
errorMsg = "Compression Test Statistics tidak dapat diimplementasi
karena adanya eror berikut :\n" + error.toString();
System.out.println(errorMsg);
invalidOut = -1d;
return (invalidOut);
}
}
}