public static void copy(final Socket inputSocket, final Socket outputSocket)
			throws IOException {

		InputStream inputStream = null;
		OutputStream outputStream = null;
		try {
			inputStream = inputSocket.getInputStream();
			outputStream = outputSocket.getOutputStream();

			final byte buf[] = new byte[3000];
			int length;
			while (true) {
				try {
					length = inputStream.read(buf);

					if (length > 0) {
						outputStream.write(buf, 0, length);
						outputStream.flush();
					} else if (length == -1) {
						break;
					}
				} catch (final InterruptedIOException ioe) {
				}
			}
		} finally {
			try {
				inputSocket.shutdownInput();
			} catch (final Exception e) {
			}
			try {
				outputSocket.shutdownOutput();
			} catch (final Exception e) {
			}
		}
	}