⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bytesender.java

📁 A byte comunication system made in java that can be used to send messages in betweeen computers on t
💻 JAVA
字号:
package ByteSendReceive;

import java.net.*;
import java.io.*;
import Commons.Address;

public class ByteSender
{
	private Socket s;
	private OutputStream oStr;
	private String myName;
	public ByteSender(String theName) { myName = theName; }


	public void deliver(Address theDest, byte[] data)
	{
		try
		{
			s = new Socket(theDest.dest(), theDest.port());
			System.out.println("Sender: Socket" + s);
			oStr = s.getOutputStream();
			oStr.write(data);
			oStr.flush();
			oStr.close();
			s.close();
		}
		catch (IOException e)
		{
			System.out.println("IOException in deliver");
		}
	}
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -