Package com.dyuproject.protostuff

Examples of com.dyuproject.protostuff.Schema


  /* (non-Javadoc)
   * @see org.directmemory.utils.Serializer#serialize(java.lang.Object, java.lang.Class)
   */
  @SuppressWarnings("unchecked")
  public byte[] serialize(Object obj, @SuppressWarnings("rawtypes") Class clazz) throws IOException {
    @SuppressWarnings("rawtypes")
    Schema schema = RuntimeSchema.getSchema(clazz);
    final LinkedBuffer buffer = LinkedBuffer.allocate(serBufferSize);
    byte[] protostuff = null;

    try {
View Full Code Here


   * @see org.directmemory.utils.Serializer#deserialize(byte[], java.lang.Class)
   */
  @SuppressWarnings("unchecked")
  public Object deserialize(byte[] source, @SuppressWarnings("rawtypes") Class clazz) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
    final Object object = clazz.newInstance();
    @SuppressWarnings("rawtypes")
    final Schema schema = RuntimeSchema.getSchema(clazz);
    ProtostuffIOUtil.mergeFrom(source, object, schema);
    return object;
 
View Full Code Here

  /* (non-Javadoc)
   * @see org.directmemory.utils.Serializer#serialize(java.lang.Object, java.lang.Class)
   */
  @SuppressWarnings("unchecked")
  public byte[] serialize(Object obj, @SuppressWarnings("rawtypes") Class clazz) throws IOException {
    @SuppressWarnings("rawtypes")
    Schema schema = RuntimeSchema.getSchema(clazz);
    final LinkedBuffer buffer = localBuffer.get();
    byte[] protostuff = null;

    try {
View Full Code Here

   * @see org.directmemory.utils.Serializer#deserialize(byte[], java.lang.Class)
   */
  @SuppressWarnings("unchecked")
  public Object deserialize(byte[] source, @SuppressWarnings("rawtypes") Class clazz) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
    Object object = clazz.newInstance();
    @SuppressWarnings("rawtypes")
    Schema schema = RuntimeSchema.getSchema(clazz);
    ProtostuffIOUtil.mergeFrom(source, object, schema);
    return object;
 
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  public byte[] serialize(Object obj, @SuppressWarnings("rawtypes") Class clazz) throws IOException {
        Stopwatch stopWatch = SimonManager.getStopwatch("serializer.PSSerialize");
    Split split = stopWatch.start();
    @SuppressWarnings("rawtypes")
    Schema schema = RuntimeSchema.getSchema(clazz);
    final LinkedBuffer buffer = LinkedBuffer.allocate(serBufferSize);
    byte[] protostuff = null;

    try {
View Full Code Here

  @SuppressWarnings("unchecked")
  public Object deserialize(byte[] source, @SuppressWarnings("rawtypes") Class clazz) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        Stopwatch stopWatch = SimonManager.getStopwatch("serializer.PSDeserialize");
    Split split = stopWatch.start();
    final Object object = clazz.newInstance();
    @SuppressWarnings("rawtypes")
    final Schema schema = RuntimeSchema.getSchema(clazz);
    ProtostuffIOUtil.mergeFrom(source, object, schema);
    split.stop();
    return object;
 
View Full Code Here

TOP

Related Classes of com.dyuproject.protostuff.Schema

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.