📄 chargenurlconnection.java
字号:
package com.macfaq.net.www.protocol.chargen;import java.net.*;import java.io.*;import com.macfaq.io.*;public class ChargenURLConnection extends URLConnection { private Socket connection = null; public final static int DEFAULT_PORT = 19; public ChargenURLConnection(URL u) { super(u); } public synchronized InputStream getInputStream() throws IOException { if (!connected) this.connect(); return new FiniteInputStream(this.connection.getInputStream()); } public String getContentType() { return "text/plain"; } public synchronized void connect() throws IOException { if (!connected) { int port = url.getPort(); if ( port < 1 || port > 65535) { port = DEFAULT_PORT; } this.connection = new Socket(url.getHost(), port); this.connected = true; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -