Code example for XMLDecoder

Methods: closereadObject

0
 
    private static void test(Locale locale, byte[] data) {
        Locale.setDefault(locale);
        System.out.println("locale = " + locale);
 
        XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(data));
        System.out.println("object = " + decoder.readObject());
        decoder.close();
    } 
 
    public static class DataBean { 
        private boolean illegal;
 
        public boolean isIllegal() { 
            return this.illegal;
        } 
 
        public void setIllegal(boolean illegal) {
            this.illegal = illegal;
        }