Package com.esotericsoftware.kryo

Examples of com.esotericsoftware.kryo.KryoException


    kryo.writeObject(deflaterOutput, object, serializer);
    deflaterOutput.flush();
    try {
      deflaterStream.finish();
    } catch (IOException ex) {
      throw new KryoException(ex);
    }
    outputChunked.endChunks();
  }
View Full Code Here


    BeanInfo info;
    try {
      info = Introspector.getBeanInfo(type);
    } catch (IntrospectionException ex) {
      throw new KryoException("Error getting bean info.", ex);
    }
    // Methods are sorted by alpha so the order of the data is known.
    PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
    Arrays.sort(descriptors, new Comparator<PropertyDescriptor>() {
      public int compare (PropertyDescriptor o1, PropertyDescriptor o2) {
View Full Code Here

        if (serializer != null)
          kryo.writeObjectOrNull(output, value, serializer);
        else
          kryo.writeClassAndObject(output, value);
      } catch (IllegalAccessException ex) {
        throw new KryoException("Error accessing getter method: " + property + " (" + type.getName() + ")", ex);
      } catch (InvocationTargetException ex) {
        throw new KryoException("Error invoking getter method: " + property + " (" + type.getName() + ")", ex);
      } catch (KryoException ex) {
        ex.addTrace(property + " (" + type.getName() + ")");
        throw ex;
      } catch (RuntimeException runtimeEx) {
        KryoException ex = new KryoException(runtimeEx);
        ex.addTrace(property + " (" + type.getName() + ")");
        throw ex;
      }
    }
  }
View Full Code Here

          value = kryo.readObjectOrNull(input, property.setMethodType, serializer);
        else
          value = kryo.readClassAndObject(input);
        property.set(object, value);
      } catch (IllegalAccessException ex) {
        throw new KryoException("Error accessing setter method: " + property + " (" + object.getClass().getName() + ")", ex);
      } catch (InvocationTargetException ex) {
        throw new KryoException("Error invoking setter method: " + property + " (" + object.getClass().getName() + ")", ex);
      } catch (KryoException ex) {
        ex.addTrace(property + " (" + object.getClass().getName() + ")");
        throw ex;
      } catch (RuntimeException runtimeEx) {
        KryoException ex = new KryoException(runtimeEx);
        ex.addTrace(property + " (" + object.getClass().getName() + ")");
        throw ex;
      }
    }
    return object;
  }
View Full Code Here

        property.set(copy, value);
      } catch (KryoException ex) {
        ex.addTrace(property + " (" + copy.getClass().getName() + ")");
        throw ex;
      } catch (RuntimeException runtimeEx) {
        KryoException ex = new KryoException(runtimeEx);
        ex.addTrace(property + " (" + copy.getClass().getName() + ")");
        throw ex;
      } catch (Exception ex) {
        throw new KryoException("Error copying bean property: " + property + " (" + copy.getClass().getName() + ")", ex);
      }
    }
    return copy;
  }
View Full Code Here

    public Object getField (Object object) throws IllegalArgumentException, IllegalAccessException {
      if (offset >= 0) {
        return unsafe().getObject(object, offset);
      } else
        throw new KryoException("Unknown offset");
    }
View Full Code Here

    public void setField (Object object, Object value) throws IllegalArgumentException, IllegalAccessException {
      if (offset != -1)
        unsafe().putObject(object, offset, value);
      else
        throw new KryoException("Unknown offset");
    }
View Full Code Here

    public void copy (Object original, Object copy) {
      try {
        if (offset != -1) {
          unsafe().putObject(copy, offset, kryo.copy(unsafe().getObject(original, offset)));
        } else
          throw new KryoException("Unknown offset");
      } catch (KryoException ex) {
        ex.addTrace(this + " (" + type.getName() + ")");
        throw ex;
      } catch (RuntimeException runtimeEx) {
        KryoException ex = new KryoException(runtimeEx);
        ex.addTrace(this + " (" + type.getName() + ")");
        throw ex;
      }
    }
View Full Code Here

        if (tags[ii] == tag) {
          cachedField = fields[ii];
          break;
        }
      }
      if (cachedField == null) throw new KryoException("Unknown field tag: " + tag + " (" + getType().getName() + ")");
      cachedField.read(input, object);
    }
    return object;
  }
View Full Code Here

        buffer.put(tmp, 0, result);
        buffer.position(offset);
      }
      return result;
    } catch (IOException ex) {
      throw new KryoException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.KryoException

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.