FAQ
Author: marvin
Date: Fri Dec 4 16:55:03 2009
New Revision: 887264

URL: http://svn.apache.org/viewvc?rev=887264&view=rev
Log:
Use CB_deserialize in Obj_deserialize now that it's available.

Modified:
lucene/lucy/trunk/core/Lucy/Object/Obj.c

Modified: lucene/lucy/trunk/core/Lucy/Object/Obj.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Obj.c?rev=887264&r1=887263&r2=887264&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Obj.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/Obj.c Fri Dec 4 16:55:03 2009
@@ -60,18 +60,13 @@
Obj_serialize(Obj *self, OutStream *outstream)
{
CharBuf *class_name = Obj_Get_Class_Name(self);
- size_t size = CB_Get_Size(class_name);
- OutStream_Write_C32(outstream, size);
- OutStream_Write_Bytes(outstream, CB_Get_Ptr8(class_name), size);
+ CB_Serialize(class_name, outstream);
}

Obj*
Obj_deserialize(Obj *self, InStream *instream)
{
- size_t size = InStream_Read_C32(instream);
- CharBuf *class_name = CB_new(size);
- CB_Set_Size(class_name, size);
- InStream_Read_Bytes(instream, CB_Get_Ptr8(class_name), size);
+ CharBuf *class_name = CB_deserialize(NULL, instream);
if (!self) {
VTable *vtable = VTable_singleton(class_name, OBJ);
self = VTable_Make_Obj(vtable);

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouplucy-commits @
categorieslucene
postedDec 4, '09 at 4:55p
activeDec 4, '09 at 4:55p
posts1
users1
websitelucene.apache.org

1 user in discussion

Marvin: 1 post

People

Translate

site design / logo © 2017 Grokbase