1 14 15 package org.apache.activemq.store.kahadaptor; 16 17 import java.io.DataInput ; 18 import java.io.DataOutput ; 19 import java.io.IOException ; 20 import org.apache.activemq.kaha.Marshaller; 21 import org.apache.activemq.store.ReferenceStore.ReferenceData; 22 23 public class ReferenceRecordMarshaller implements Marshaller<ReferenceRecord>{ 24 25 public ReferenceRecord readPayload(DataInput dataIn) throws IOException { 26 ReferenceRecord rr=new ReferenceRecord(); 27 rr.setMessageId(dataIn.readUTF()); 28 ReferenceData referenceData = new ReferenceData(); 29 referenceData.setFileId(dataIn.readInt()); 30 referenceData.setOffset(dataIn.readInt()); 31 referenceData.setExpiration(dataIn.readLong()); 32 rr.setData(referenceData); 33 return rr; 34 } 35 36 42 public void writePayload(ReferenceRecord rr,DataOutput dataOut) throws IOException { 43 dataOut.writeUTF(rr.getMessageId()); 44 dataOut.writeInt(rr.getData().getFileId()); 45 dataOut.writeInt(rr.getData().getOffset()); 46 dataOut.writeLong(rr.getData().getExpiration()); 47 } 48 } 49 | Popular Tags |