Package com.nokia.dempsy.serialization

Examples of com.nokia.dempsy.serialization.SerializationException


                try
                {
                    info = objectMapper.readValue(jsonData, ArrayList.class);
                } catch (final Exception e)
                {
                    throw new SerializationException("Error occured while deserializing data " + jsonData, e);
                }
            }
            return (info != null && info.size() > 0) ? info.get(0) : null;
        }
View Full Code Here


                try
                {
                    jsonData = objectMapper.writeValueAsString(arr);
                } catch (final Exception e)
                {
                    throw new SerializationException("Error occured during serializing class " +
                            SafeString.valueOfClass(data) + " with information " + SafeString.valueOf(data), e);
                }
            }
            return (jsonData != null) ? jsonData.getBytes() : null;
        }
View Full Code Here

         k.kryo.writeClassAndObject(k.output, object);
         return k.output.toBytes();
      }
      catch (KryoException ke)
      {
         throw new SerializationException("Failed to serialize.",ke);
      }
      catch (IllegalArgumentException e) // this happens when requiring registration but serializing an unregistered class
      {
         throw new SerializationException("Failed to serialize " + SafeString.objectDescription(object) +
               " (did you require registration and attempt to serialize an unregistered class?)", e);
      }
      finally
      {
         if (k != null)
View Full Code Here

         k.input.setBuffer(data);
         return (T)(k.kryo.readClassAndObject(k.input))
      }
      catch (KryoException ke)
      {
         throw new SerializationException("Failed to deserialize.",ke);
      }
      catch (IllegalArgumentException e) // this happens when requiring registration but deserializing an unregistered class
      {
         throw new SerializationException("Failed to deserialize. Did you require registration and attempt to deserialize an unregistered class?", e);
      }
      finally
      {
         if (k != null)
            kryopool.offer(k);
View Full Code Here

         in = new ObjectInputStream(bis);
         @SuppressWarnings("unchecked")
         T readObject = (T) ((ObjectInputStream)in).readObject();
         return readObject;
      }
      catch(IOException e) { throw new SerializationException(e); }
      catch(ClassNotFoundException e) { throw new SerializationException(e); }
   }
View Full Code Here

      {
         out = new ObjectOutputStream(bos);
         out.writeObject(object); // no need to reset the stream since we're tossing it.
         out.flush();
      }
      catch(IOException e) { throw new SerializationException(e); }

      byte[] data = bos.toByteArray();
      return data;
   }
View Full Code Here

TOP

Related Classes of com.nokia.dempsy.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.