Package me.prettyprint.hector.api.exceptions

Examples of me.prettyprint.hector.api.exceptions.HectorSerializationException


      Object obj = ois.readObject();
      ois.close();

      return obj;
    } catch (Exception ex) {
      throw new HectorSerializationException(ex);
    }
  }
View Full Code Here


      Object obj = ois.readObject();
      bytes.position(bytes.position() + (l - ois.available()));
      ois.close();
      return obj;
    } catch (Exception ex) {
      throw new HectorSerializationException(ex);
    }
  }
View Full Code Here

    if (compareByteArrays(prefixBytes.array(), prefixBytes.arrayOffset()
        + prefixBytes.position(), prefixBytes.remaining(), bytes.array(),
        bytes.arrayOffset() + bytes.position(), prefixBytes.remaining()) != 0) {
      log.error("Unprefixed value received, throwing exception...");
      throw new HectorSerializationException("Unexpected prefix value");
    }
    bytes.position(prefixBytes.remaining());

    S s = suffixSerializer.fromByteBuffer(bytes);
    return s;
View Full Code Here

      XMLStreamWriter writer = createStreamWriter(buffer);
      marshaller.get().marshal(obj, writer);
      writer.flush();
      writer.close();
    } catch (JAXBException e) {
      throw new HectorSerializationException("Object to serialize " + obj
          + " does not seem compatible with the configured JaxbContext;"
          + " note this Serializer works only with JAXBable objects.", e);
    } catch (XMLStreamException e) {
      throw new HectorSerializationException(
          "Exception occurred writing XML stream.", e);
    }
    return ByteBuffer.wrap(buffer.toByteArray());
  }
View Full Code Here

      XMLStreamReader reader = createStreamReader(bais);
      Object ret = unmarshaller.get().unmarshal(reader);
      reader.close();
      return ret;
    } catch (JAXBException e) {
      throw new HectorSerializationException(
          "Jaxb exception occurred during deserialization.", e);
    } catch (XMLStreamException e) {
      throw new HectorSerializationException("Exception reading XML stream.", e);
    }
  }
View Full Code Here

TOP

Related Classes of me.prettyprint.hector.api.exceptions.HectorSerializationException

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.