Package net.kuujo.vertigo.util.serialization

Examples of net.kuujo.vertigo.util.serialization.SerializationException


  @Override
  public <T> byte[] serializeToBytes(T object) {
    try {
      return mapper.writeValueAsBytes(object);
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here


  @Override
  public <T> T deserializeBytes(byte[] json, Class<T> type) {
    try {
      return mapper.readValue(json, type);
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here

  @Override
  public <T> T deserializeBytes(byte[] json, TypeReference<T> type) {
    try {
      return mapper.readValue(json, type);
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here

  @Override
  public <T> String serializeToString(T object) {
    try {
      return mapper.writeValueAsString(object);
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here

  @Override
  public <T> T deserializeString(String json, Class<T> type) {
    try {
      return mapper.readValue(json, type);
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here

  @Override
  public <T> T deserializeString(String json, TypeReference<T> type) {
    try {
      return mapper.readValue(json, type);
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here

  @Override
  public <T> JsonObject serializeToObject(T object) {
    try {
      return new JsonObject(mapper.writeValueAsString(object));
    } catch (Exception e) {
      throw new SerializationException(e.getMessage());
    }
  }
View Full Code Here

          ObjectInputStream stream = null;
          try {
            stream = new ThreadObjectInputStream(new ByteArrayInputStream(bytes));
            return stream.readObject();
          } catch (ClassNotFoundException | IOException e) {
            throw new SerializationException(e.getMessage());
          } finally {
            if (stream != null) {
              try {
                stream.close();
              } catch (IOException e) {
View Full Code Here

    byte[] serialized = null;
    try {
      stream = new ObjectOutputStream(byteStream);
      stream.writeObject(message);
    } catch (IOException e) {
      throw new SerializationException(e.getMessage());
    } finally {
      if (stream != null) {
        try {
          stream.close();
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.util.serialization.SerializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.