Fail to deserialize when call optimize

Description

instance = DocSetFactory.getPForDeltaDocSetInstance();
instance.addDoc(1);
....
instance.optimize(); //if no line,works fine!

val bytes = PForDeltaDocIdSet.serialize(obj)

val bytesSize = new Array[Byte](Conversion.BYTES_PER_INT)
input.read(bytesSize)
val totalNumInt = Conversion.byteArrayToInt(bytesSize, 0)
val bytesData = new Array[Byte](totalNumInt * Conversion.BYTES_PER_INT)
input.read(bytesData)
PForDeltaDocIdSet.deserialize(bytesData,0)

Environment

None

Activity

Show:
Jun Tsai
March 8, 2013, 1:41 PM

Exception:

java.lang.IllegalArgumentException: len must be greater than 0: 0
at com.kamikaze.docidset.utils.PrimitiveArray.<init>(PrimitiveArray.java:49)
at com.kamikaze.docidset.utils.IntArray.<init>(IntArray.java:40)
at com.kamikaze.docidset.utils.IntArray.newInstanceFromBytes(IntArray.java:135)
at com.kamikaze.docidset.impl.PForDeltaDocIdSet.deserialize(PForDeltaDocIdSet.java:99)

Assignee

hao yan

Reporter

Jun Tsai

Labels

None

Components

Affects versions

Priority

Major
Configure