// System.out.println("ABORTING more data than expected in header");
return true;
}
if ((ctsize - readb) < qa_minlen)
{
/* only little more left */
// System.out.println("Continue, more than minlen bytes left.");
return false;
}
if ((ctsize - readb) > qa_maxlen)
{
/* too much left to go */
// System.out.println("Abort, more than maxlen bytes left.");
return true;
}
if ( (float)readb / ctsize > qa_percent)
{
/* past point of no return */
// System.out.println("Percentage ratio is good, continue");
return false;
} else
{
// System.out.println("Percentage ratio is bad, abort");
return true;
}
}
// System.out.println("Unknown data size?, abort");
return true; /* STOP DOWNLOADING! */
/*
return false; no dobra povolime to, ale vypadne to na timeout nebo
na pocet dat */
}
final public static String printDate(Date d)
{
try
{
return formatter.format(d);
}
catch (Exception z)
{
z.printStackTrace();
System.out.println("[JAVA_INTERNAL_ERROR] SimpleDateFormat.format(d) failed\nDate format=EEE, dd MMM yyyy HH:mm:ss 'GMT' BadDate(formated)="+d+" time(long)="+d.getTime()+" THIS IS A JAVA BUG.\nREPORT TO http://java.sun.com/cgi-bin/bugreport.cgi");
}
return null;
}
final public boolean canCache()
{
return cacheable;
}
final public void nocache()
{
cacheable=false;
}
final public void sendString(String arg) throws IOException
{
out.writeBytes(arg);
}
final public void sendBytes(byte b[]) throws IOException