Package com.dyuproject.protostuff

Examples of com.dyuproject.protostuff.LinkedBuffer.clear()


    byte[] protostuff = null;

    try {
      protostuff = ProtostuffIOUtil.toByteArray(obj, schema, buffer);
    } finally {
      buffer.clear();
    }   
    return protostuff;
  }

  /* (non-Javadoc)
 
View Full Code Here


    byte[] protostuff = null;

    try {
      protostuff = ProtostuffIOUtil.toByteArray(obj, schema, buffer);
    } finally {
      buffer.clear();
    }   
    return protostuff;
  }

  /* (non-Javadoc)
 
View Full Code Here

     byte[] protostuff = null;

     try {
       protostuff = ProtostuffIOUtil.toByteArray(obj, schema, buffer);
     } finally {
       buffer.clear();
     }   

     return protostuff;
  }
View Full Code Here

    byte[] protostuff = null;

    try {
      protostuff = ProtostuffIOUtil.toByteArray(obj, schema, buffer);
    } finally {
      buffer.clear();
    }   
    split.stop();
    return protostuff;
  }
View Full Code Here

        {
            protostuff = toByteArray( obj, schema, buffer );
        }
        finally
        {
            buffer.clear();
        }
        return protostuff;
    }

    /**
 
View Full Code Here

        {
            protostuff = toByteArray( obj, schema, buffer );
        }
        finally
        {
            buffer.clear();
        }
        return protostuff;
    }

    /**
 
View Full Code Here

    LinkedBuffer buffer = LinkedBuffer.allocate(BUF_SIZE);
    try {
        for (int i = 0; i < params.length; ++i) {
            Schema<Object> schema = (Schema<Object>) RuntimeSchema.getSchema(params[i].getClass());
            ProtostuffIOUtil.writeDelimitedTo(out, params[i], schema, buffer);
            buffer.clear();
        }
    } catch (Exception e) {
            throw new SeriException("Error occured when serialize using protostuff.", e);
        }
    return out.toByteArray();
View Full Code Here

    @Override
    public T deserialize(T t) throws IOException {
      t = (t == null) ? newInstance() : t;
      LinkedBuffer buff = threadLocalBuffer.get();
      ProtobufIOUtil.mergeDelimitedFrom(in, t, t, buff);
      buff.clear();
      return t;
    }

    private T newInstance() {
      return (T) ReflectionUtils.newInstance(tClass, null);
View Full Code Here

    @Override
    public void serialize(T t) throws IOException {
      LinkedBuffer buff = threadLocalBuffer.get();
      ProtobufIOUtil.writeDelimitedTo(out, t, t, buff);
      buff.clear();
    }

    @Override
    public void close() throws IOException {
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.