Username:   Password:  

test

	import java.io.FileOutputStream;
	import java.io.IOException;
	import java.io.InputStream;
	import java.io.OutputStream;
 
	public class Test
	{
		public static void main (String args[]) throws IOException
		{
			String from = "D:/src/test.jpg";
			String to = "D:/dest/test.jpg";
			copy(from, to);
		}
		public static void copy (String from, String to) throws IOException
		{
			InputStream in = null;
			OutputStream out = null;
			System.out.println(System.currentTimeMillis())
			{
				try
				{
					InputStream inFile = new FileInputStream (from);
					in = new BufferedInputStream (inFile);
					OutputStream out = new FileOutputStream (to);
					out = new BufferedOutputstream (outFile);
					while (true)
					{
						int data = in.read();
						if (data == -1)
						{
							break;
						}
						out.write(data);
					}
					System.out.println(System.currentTimeMillis());
				}
				finally
				{
					if (in != null)
					{
						in.close();
					}
					if (out != null)
					{
						out.close();
					}
				}
			}
		}

test

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
 
public class Test
{
	public static void main (String args[]) throws IOException
	{
		String from = "D:/src/test.jpg";
		String to = "D:/dest/test.jpg";
		copy(from, to);
	}
	public static void copy (String from, String to) throws IOException
	{
		InputStream in = null;
		OutputStream out = null;
		System.out.println(System.currentTimeMillis())
		{
			try
			{
				in = new FileInputStream(from);
				out = new FileOutputStream(to);
				while(true)
				{
					int data = in.read();
					if (data == -1)
					{
						break;
					}
					out.write(data)
				}
				System.out.println(System.currentTimeMillis())
			}
			finally
			{
				if (in != null)
				{
					in.close();
				}
				if (out != null)
				{
					out.close();
				}
			}
		}
	}

test

int iSize = strTest.size();
for (int iIndex = 0; iIndex < iSize; iIndex++)

test

int iSize = strTest.size();
for (int iIndex = 0; iIndex < iSize; iIndex++

tset

for (int iIndex = 0; iIndex < strTest.size(); iIndex++)

<< older