OSDN Git Service

3fba41d5085242a9b504d538383c418412a4fc1a
[mikumikustudio/MikuMikuStudio.git] / junit / com / jme / util / export / binary / Snafu.java
1 package com.jme.util.export.binary;
2
3 import java.io.IOException;
4 import java.util.logging.Level;
5 import java.util.logging.Logger;
6
7 import com.jme.util.export.JMEExporter;
8 import com.jme.util.export.JMEImporter;
9 import com.jme.util.export.Savable;
10
11 public class Snafu extends Bar implements Savable {
12     private static final Logger logger = Logger
13             .getLogger(Snafu.class.getName());
14     
15     int test = 0;
16     
17     public Snafu() {}
18     
19     public void write(JMEExporter e) {
20         super.write(e);
21         try {
22             e.getCapsule(this).write(test, "test", 0);
23         } catch (IOException e1) {
24             logger.logp(Level.SEVERE, this.getClass().toString(), "write(JMEExporter e)", "Exception", e1);
25         }
26         
27     }
28     
29     public void read(JMEImporter e) {
30         super.read(e);
31         try {
32             test = e.getCapsule(this).readInt("test", 0);
33         } catch (IOException e1) {
34             logger.logp(Level.SEVERE, this.getClass().toString(), "read(JMEImporter e)", "Exception", e1);
35         }
36     }
37 }