Search in sources :

Example 1 with ImageSerializer

use of data.media.writeAsArray.ImageSerializer in project fastjson by alibaba.

the class BenchmarkMain_EishayEncode_WriteAsArray method main.

public static void main(String[] args) throws Exception {
    SerializeConfig config = SerializeConfig.getGlobalInstance();
    config.put(MediaContent.class, new MediaContentSerializer());
    config.put(Media.class, new MediaSerializer());
    config.put(Image.class, new ImageSerializer());
    System.out.println(System.getProperty("java.vm.name") + " " + System.getProperty("java.runtime.version"));
    List<String> arguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
    System.out.println(arguments);
    MediaContent content = EishayDecodeBytes.instance.getContent();
    String text = encode(content);
    System.out.println(text);
    for (int i = 0; i < 10; ++i) {
        perf(text);
    }
}
Also used : SerializeConfig(com.alibaba.fastjson.serializer.SerializeConfig) MediaContentSerializer(data.media.writeAsArray.MediaContentSerializer) MediaSerializer(data.media.writeAsArray.MediaSerializer) MediaContent(data.media.MediaContent) ImageSerializer(data.media.writeAsArray.ImageSerializer)

Aggregations

SerializeConfig (com.alibaba.fastjson.serializer.SerializeConfig)1 MediaContent (data.media.MediaContent)1 ImageSerializer (data.media.writeAsArray.ImageSerializer)1 MediaContentSerializer (data.media.writeAsArray.MediaContentSerializer)1 MediaSerializer (data.media.writeAsArray.MediaSerializer)1