@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); } } }
private JsonElement readJson(AssetDataFile input) throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(input.openStream(), Charsets.UTF_8))) { return parser.parse(reader); } }