changed writeMap

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3065 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 18 years ago
parent fb9e0f0284
commit 5b00a04359

@ -232,25 +232,18 @@ abstract class kelondroAbstractRA implements kelondroRA {
this.seek(0); this.seek(0);
final Iterator iter = map.entrySet().iterator(); final Iterator iter = map.entrySet().iterator();
Map.Entry entry; Map.Entry entry;
serverByteBuffer bb = new serverByteBuffer(map.size() * 40); final serverByteBuffer bb = new serverByteBuffer(map.size() * 40);
bb.append("# " + comment); bb.append("# ").append(comment).append("\r\n");
bb.append(cr);
bb.append(lf);
while (iter.hasNext()) { while (iter.hasNext()) {
entry = (Map.Entry) iter.next(); entry = (Map.Entry) iter.next();
bb.append((String) entry.getKey()); bb.append((String) entry.getKey()).append('=');
bb.append('='); if (entry.getValue() != null) { bb.append(entry.getValue().toString()); }
bb.append((String) entry.getValue()); bb.append("\r\n");
bb.append(cr);
bb.append(lf);
} }
bb.append("# EOF"); bb.append("# EOF\r\n");
bb.append(cr);
bb.append(lf);
write(bb.getBytes()); write(bb.getBytes());
} }
public Map readMap() throws IOException { public Map readMap() throws IOException {
this.seek(0); this.seek(0);
byte[] b = readFully(); byte[] b = readFully();

Loading…
Cancel
Save