00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 package com.sleepycat.db;
00011
00012 import com.sleepycat.db.internal.DbConstants;
00013 import com.sleepycat.db.internal.DbUtil;
00014
00015 public class MultipleDataEntry extends MultipleEntry {
00016 public MultipleDataEntry() {
00017 super(null, 0, 0);
00018 }
00019
00020 public MultipleDataEntry(final byte[] data) {
00021 super(data, 0, (data == null) ? 0 : data.length);
00022 }
00023
00024 public MultipleDataEntry(final byte[] data,
00025 final int offset,
00026 final int size) {
00027 super(data, offset, size);
00028 }
00029
00034
00035 int getMultiFlag() {
00036 pos = 0;
00037 return DbConstants.DB_MULTIPLE;
00038 }
00039
00040 public boolean next(final DatabaseEntry data) {
00041 if (pos == 0)
00042 pos = ulen - INT32SZ;
00043
00044 final int dataoff = DbUtil.array2int(this.data, pos);
00045
00046
00047 if (dataoff < 0) {
00048 return (false);
00049 }
00050
00051 pos -= INT32SZ;
00052 final int datasz = DbUtil.array2int(this.data, pos);
00053
00054 pos -= INT32SZ;
00055
00056 data.setData(this.data);
00057 data.setSize(datasz);
00058 data.setOffset(dataoff);
00059
00060 return (true);
00061 }
00062 }