elf01b
elf01b

Reputation: 64

How to read file xsb XML Schema Binary File

How to read file xsb XML Schema Binary File. I extract file xmlbeans-3.0.1.jar and see many binary file *.xsb inside. https://jar-download.com/artifacts/org.apache.xmlbeans/xmlbeans/3.0.1 I'm curious about what data is inside file *.xsb? And How to read file xsb XML Schema Binary File using java code?

Upvotes: 0

Views: 779

Answers (1)

elf01b
elf01b

Reputation: 64

@Joe: Do you have any example code using DataInputStream to read a file base.xsb from file jar https://jar-download.com/artifacts/org.apache.xmlbeans/xmlbeans/3.0.1

\xmlbeans-3.0.1\ schemaorg_apache_xmlbeans\ attribute\http_3A_2F_2Fwww_2Ew3_2Eorg_2FXML_2F1998_2Fnamespace\base.xsb

This code is not work

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;
    }
}
}

Upvotes: 0

Related Questions