예제 #1
0
 @Override
 public void apply(AssetDataFile input, TextureData assetData) throws IOException {
   try (InputStreamReader reader = new InputStreamReader(input.openStream(), Charsets.UTF_8)) {
     TextureMetadata metadata = gson.fromJson(reader, TextureMetadata.class);
     if (metadata.filterMode != null) {
       assetData.setFilterMode(metadata.filterMode);
     }
     if (metadata.wrapMode != null) {
       assetData.setWrapMode(metadata.wrapMode);
     }
     if (metadata.type != null) {
       assetData.setType(metadata.type);
     }
   }
 }
예제 #2
0
 private JsonElement readJson(AssetDataFile input) throws IOException {
   try (BufferedReader reader =
       new BufferedReader(new InputStreamReader(input.openStream(), Charsets.UTF_8))) {
     return parser.parse(reader);
   }
 }