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

📄 wbxmlroundtrip.java

📁 j2me简单实例,j2me教程加源码,希望大家喜欢
💻 JAVA
字号:
import java.io.*;import org.kxml2.io.*;import org.kxml2.wap.*;import org.xmlpull.v1.*;/* * Created on 25.09.2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments *//** * @author haustein * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */public class WbxmlRoundtrip {	public static void main(String[] argv) throws Exception {				ByteArrayOutputStream bos = new ByteArrayOutputStream();				XmlPullParser xp = new KXmlParser();		xp.setInput(new FileReader(argv[0]));		XmlSerializer xs = new WbxmlSerializer();		xs.setOutput(bos, null); 				new Roundtrip(xp, xs).roundTrip();				byte[] wbxml = bos.toByteArray();				for(int i = 0; i < wbxml.length; i += 16){			for (int j = i; j < Math.min(i + 16, wbxml.length); j ++) {				int b = ((int) wbxml[j]) & 0x0ff;				System.out.print(Integer.toHexString(b / 16));				System.out.print(Integer.toHexString(b % 16));				System.out.print(' ');			}						for (int j = i; j < Math.min(i + 16, wbxml.length); j ++) {				int b = wbxml[j];				System.out.print(b >= 32 && b <= 127 ? (char) b : '?');			}						System.out.println();		}				ByteArrayInputStream bis = new ByteArrayInputStream(wbxml);				xp = new WbxmlParser();		xp.setInput(bis, null);				xs = new KXmlSerializer();		xs.setOutput(System.out, null);				new Roundtrip(xp, xs).roundTrip();	}}

⌨️ 快捷键说明

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