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

📄 systemurlconnection.java

📁 kaffe是一个java虚拟机的源代码。里面包含了一些java例程和标准的java包。
💻 JAVA
字号:
/* * SystemURLConnection - *  URL connection to internal system resources. * * Copyright (c) 1998 *      Transvirtual Technologies, Inc.  All rights reserved. * * See the file "license.terms" for information on usage and redistribution * of this file. */package kaffe.net.www.protocol.system;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;import java.net.URL;import kaffe.net.www.protocol.BasicURLConnection;import kaffe.lang.Application;public class SystemURLConnection  extends BasicURLConnection{	private InputStream data;public SystemURLConnection(URL url){	super(url);}public void connect() throws IOException{	String filename = url.getFile();	Application currentApp = Application.getApplication();	if (currentApp != null) {		data = currentApp.getResourceAsStream(filename);	} else {		data = ClassLoader.getSystemResourceAsStream(filename);	}	setContentTypeFromName();}public InputStream getInputStream() throws IOException{	if (data == null) {		throw new FileNotFoundException(url.getFile());	}	return data;}}

⌨️ 快捷键说明

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