public byte[] EncodeTo() {
		byte[] ret = new byte[0];
		if (has_comparator_) {
			ret = util.add(ret, coding.PutVarint32(Tag.kComparator),
					coding.PutLengthPrefixedSlice(new Slice(comparator_)));
		}
		if (has_log_number_) {
			ret = util.add(ret, coding.PutVarint32(Tag.kLogNumber),
					coding.PutVarint64(log_number_));
		}
		if (has_prev_log_number_) {
			ret = util.add(ret, coding.PutVarint32(Tag.kPrevLogNumber),
					coding.PutVarint64(prev_log_number_));
		}
		if (has_next_file_number_) {
			ret = util.add(ret, coding.PutVarint32(Tag.kNextFileNumber),
					coding.PutVarint64(next_file_number_));
		}
		if (has_last_sequence_) {
			ret = util.add(ret, coding.PutVarint32(Tag.kLastSequence),
					coding.PutVarint64(last_sequence_.value));
		}

		for (int i = 0; i < compact_pointers_.size(); i++) {
			ret = util.addN(
					ret,
					coding.PutVarint32(Tag.kCompactPointer),
					coding.PutVarint32(compact_pointers_.get(i).getFirst()
							.intValue()),
					coding.PutLengthPrefixedSlice(compact_pointers_.get(i)
							.getSecond().Encode()));
			// level
		}

		java.util.Iterator<Pair<Integer, Long>> iter = deleted_files_
				.iterator();
		while (iter.hasNext()) {
			Pair<Integer, Long> p = iter.next();
			ret = util.addN(ret, coding.PutVarint32(Tag.kDeletedFile),
					coding.PutVarint32(p.getFirst().intValue()),
					coding.PutVarint64(p.getSecond().longValue()));
		}

		java.util.Iterator<Pair<Integer, FileMetaData>> iter2 = new_files_
				.iterator();
		while (iter2.hasNext()) {
			Pair<Integer, FileMetaData> p = iter2.next();
			FileMetaData f = p.getSecond();
			ret = util.addN(ret, coding.PutVarint32(Tag.kNewFile),
					coding.PutVarint32(p.getFirst().intValue()),
					coding.PutVarint64(f.getNumber()),
					coding.PutVarint64(f.getFile_size()),
					coding.PutLengthPrefixedSlice(f.getSmallest().Encode()),
					coding.PutLengthPrefixedSlice(f.getLargest().Encode()));

		}

		return ret;

	}