All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.jangaroo.apprunner.util.DynamicPackagesDeSerializer Maven / Gradle / Ivy

There is a newer version: 4.1.17
Show newest version
package net.jangaroo.apprunner.util;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.List;

public class DynamicPackagesDeSerializer {

  public static List readDynamicPackages(InputStream dynamicPackagesSource) throws IOException {
    //noinspection unchecked
    return new ObjectMapper().readValue(dynamicPackagesSource, List.class);
  }

  public static void writeDynamicPackages(OutputStream output, Collection dynamicPackages) throws IOException {
    new ObjectMapper().writerWithDefaultPrettyPrinter().writeValue(new PrintWriter(output), dynamicPackages);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy