1 18 package org.apache.activemq.store.kahadaptor; 19 20 import java.io.DataInput ; 21 import java.io.DataOutput ; 22 import java.io.IOException ; 23 import org.apache.activemq.kaha.Marshaller; 24 import org.apache.activemq.kaha.impl.index.IndexItem; 25 26 27 31 public class StoreEntryMarshaller implements Marshaller{ 32 33 34 public void writePayload(Object object,DataOutput dataOut) throws IOException { 35 IndexItem item = (IndexItem)object; 36 dataOut.writeLong(item.getOffset()); 37 item.write(dataOut); 38 39 } 40 41 public Object readPayload(DataInput dataIn) throws IOException { 42 IndexItem item = new IndexItem(); 43 item.setOffset(dataIn.readLong()); 44 item.read(dataIn); 45 return item; 46 } 47 } 48 | Popular Tags |