如何读取文件 xsb XML Schema Binary File。我提取文件 xmlbeans-3.0.1.jar 并在其中看到许多二进制文件 *.xsb。 https://jar-download.com/artifacts/org.apache.xmlbeans/xmlbeans/3.0.1 我很好奇文件 *.xsb 中有哪些数据?以及如何使用 java 代码读取文件 xsb XML Schema Binary File?
问问题
229 次
1 回答
0
@Joe:您是否有任何示例代码使用 DataInputStream 从文件 jar https://jar-download.com/artifacts/org.apache.xmlbeans/xmlbeans/3.0.1读取文件 base.xsb
\xmlbeans-3.0.1\ schemaorg_apache_xmlbeans\ 属性\http_3A_2F_2Fwww_2Ew3_2Eorg_2FXML_2F1998_2Fnamespace\base.xsb
此代码不起作用
package layout;
import java.io.*;
class DataInputStreamDemo {
public static void main( String args[] ) throws IOException {
try ( DataInputStream din =
new DataInputStream( new FileInputStream( "base.xsb" ) ) ) {
// illustrating readDouble() method
double a = din.readDouble();
// illustrating readInt() method
int b = din.readInt();
// illustrating readBoolean() method
boolean c = din.readBoolean();
// illustrating readChar() method
char d = din.readChar();
System.out.println( "Values: " + a + " " + b + " " + c + " " + d );
}
catch ( FileNotFoundException e ) {
System.out.println( "Cannot Open the Input File" );
return;
}
}
}
于 2020-05-25T06:33:02.963 回答