PrintWriter out = new PrintWriter(new FileWriter(outFile));
out.print(txt);
out.close();
Thursday, January 21, 2010
Monday, December 28, 2009
Eclipse run configuration for appengine python project
Thursday, June 25, 2009
Saturday, June 13, 2009
Zipping large file with winrar
It took around 6 hours to zip 21.5 GB file and resulting rar file size is 4GB. It took around 18 minutes to extract zipped file. The file is a SQL server database backup.
Thursday, May 7, 2009
Thursday, February 19, 2009
Converting file length into User friendly format (GB, MB, KB, Bytes)
Use following function to convert file length in bytes to user friendly format
private string FormatByteSize(long length)
{
const int KB = 1024;
const int MB = 1024 * KB;
const int GB = 1024 * MB;
if (length > GB)
{
return (length / GB).ToString("0.00") + " GB";
}
else if (length > MB)
{
return (length / MB).ToString("0.00") + " MB";
}
else if (length > KB)
{
return (length / KB).ToString("0.00") + " KB";
}
return length.ToString()+" Bytes";
}
Subscribe to:
Posts (Atom)

