Examples of SerializationException


Examples of bm.core.io.SerializationException

//            log.debug( "serialize: " + out );
            save( out );
        }
        catch( IOException e )
        {
            throw new SerializationException( CoreConstants.ERR_PRP_SERIALIZE, e );
        }
    }
View Full Code Here

Examples of cgl.imr.base.SerializationException

        }
      }
      dis.close();
      bis.close();
    } catch (IOException ioe) {
      throw new SerializationException(ioe);
    }
  }
View Full Code Here

Examples of cli.System.Runtime.Serialization.SerializationException

                new InteropObjectOutputStream(info, obj, cl, desc);
            }
        }
        catch (IOException x)
        {
            ikvm.runtime.Util.throwException(new SerializationException(x.getMessage(), x));
        }
    }
View Full Code Here

Examples of com.apitrary.api.client.exception.SerializationException

  protected <T> Response<T> deserialize(InputStream inputStream, Request<T> request) {
    String content = null;
    try {
      content = IOUtils.readStringFromStream(inputStream);
    } catch (IOException e) {
      throw new SerializationException(e);
    }
    return deserialize(content, request);
  }
View Full Code Here

Examples of com.badlogic.gdx.utils.SerializationException

    data = new SkinData();
    data.texture = new Texture(textureFile);
    try {
      getJsonLoader(skinFile).fromJson(Skin.class, skinFile);
    } catch (SerializationException ex) {
      throw new SerializationException("Error reading file: " + skinFile, ex);
    }
  }
View Full Code Here

Examples of com.cloudcontrolled.api.client.exception.SerializationException

  protected <T> Response<T> deserializeError(InputStream inputStream, Request<T> request) {
    String content = null;
    try {
      content = IOUtils.readStringFromStream(inputStream);
    } catch (IOException e) {
      throw new SerializationException(e);
    }

    return deserializeError(content, request);
  }
View Full Code Here

Examples of com.cloudera.cdk.data.SerializationException

   */
  public static <T> T readAvroEntity(Decoder decoder, DatumReader<T> reader) {
    try {
      return reader.read(null, decoder);
    } catch (IOException e) {
      throw new SerializationException("Could not deserialize Avro entity", e);
    }
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.SerializationException

      byte methodIndex = buffer.get();
      CachedMethod cachedMethod;
      try {
        cachedMethod = getMethods(kryo, methodClass)[methodIndex];
      } catch (IndexOutOfBoundsException ex) {
        throw new SerializationException("Invalid method index " + methodIndex + " for class: " + methodClass.getName());
      }
      method = cachedMethod.method;

      args = new Object[cachedMethod.serializers.length];
      for (int i = 0, n = args.length; i < n; i++) {
View Full Code Here

Examples of com.esotericsoftware.kryo.SerializationException

        if (!IntSerializer.canRead(readBuffer, true)) return null;
      }
      currentObjectLength = IntSerializer.get(readBuffer, true);

      if (currentObjectLength <= 0) throw new SerializationException("Invalid object length: " + currentObjectLength);
      if (currentObjectLength > readBuffer.capacity())
        throw new SerializationException("Unable to read object larger than read buffer: " + currentObjectLength);
    }

    int length = currentObjectLength;
    if (readBuffer.remaining() < length) {
      // Read the bytes for the next object from the socket.
      readBuffer.compact();
      int bytesRead = socketChannel.read(readBuffer);
      readBuffer.flip();
      if (bytesRead == -1) throw new SocketException("Connection is closed.");
      lastReadTime = System.currentTimeMillis();

      if (readBuffer.remaining() < length) return null;
    }
    currentObjectLength = 0;

    int startPosition = readBuffer.position();
    int oldLimit = readBuffer.limit();
    readBuffer.limit(startPosition + length);

    Context context = Kryo.getContext();
    context.put("connection", connection);
    context.setRemoteEntityID(connection.id);
    Object object = kryo.readClassAndObject(readBuffer);

    readBuffer.limit(oldLimit);
    if (readBuffer.position() - startPosition != length)
      throw new SerializationException("Incorrect number of bytes (" + (startPosition + length - readBuffer.position())
        + " remaining) used to deserialize object: " + object);

    return object;
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.SerializationException

      context.put("connection", connection);
      context.setRemoteEntityID(connection.id);
      try {
        kryo.writeClassAndObject(tempWriteBuffer, object);
      } catch (SerializationException ex) {
        throw new SerializationException("Unable to serialize object of type: " + object.getClass().getName(), ex);
      }
      tempWriteBuffer.flip();

      // Write data length.
      int dataLength = tempWriteBuffer.limit() - 5;
      int lengthLength = IntSerializer.length(dataLength, true);
      int start = 5 - lengthLength;
      tempWriteBuffer.position(start);
      IntSerializer.put(tempWriteBuffer, dataLength, true);
      tempWriteBuffer.position(start);

      try {
        if (writeBuffer.position() > 0) {
          // Other data is already queued, append this data to be written later.
          writeBuffer.put(tempWriteBuffer);
        } else if (!writeToSocket(tempWriteBuffer)) {
          // A partial write occurred, queue the remaining data to be written later.
          writeBuffer.put(tempWriteBuffer);
          // Set OP_WRITE to be notified when more writing can occur.
          selectionKey.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
        }
      } catch (BufferOverflowException ex) {
        throw new SerializationException(
          "Write buffer limit exceeded writing object of type: " + object.getClass().getName(), ex);
      }

      if (DEBUG || TRACE) {
        float percentage = writeBuffer.position() / (float)writeBuffer.capacity();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.