- fix for blog/wiki error

- re-enabled new map writing methods
see http://www.yacy-forum.de/viewtopic.php?p=21729#21729

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2124 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent ee1cc99c2f
commit af098b815c

@ -53,6 +53,8 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import de.anomic.server.serverByteBuffer;
abstract class kelondroAbstractRA implements kelondroRA { abstract class kelondroAbstractRA implements kelondroRA {
// logging support // logging support
@ -191,7 +193,7 @@ abstract class kelondroAbstractRA implements kelondroRA {
bb[bbsize++] = (byte) c; bb[bbsize++] = (byte) c;
} }
} }
/*
public void writeMap(final Map map, final String comment) throws IOException { public void writeMap(final Map map, final String comment) throws IOException {
this.seek(0); this.seek(0);
writeLine("# " + comment); writeLine("# " + comment);
@ -221,28 +223,28 @@ abstract class kelondroAbstractRA implements kelondroRA {
} }
return map; return map;
} }
*/
/*
public void writeMap(final Map map, final String comment) throws IOException { public void writeMap(final Map map, final String comment) throws IOException {
this.seek(0); this.seek(0);
final Iterator iter = map.entrySet().iterator(); final Iterator iter = map.entrySet().iterator();
Map.Entry entry; Map.Entry entry;
StringBuffer sb = new StringBuffer(map.size() * 40); serverByteBuffer bb = new serverByteBuffer(map.size() * 40);
sb.append("# " + comment); bb.append("# " + comment);
sb.append(cr); bb.append(cr);
sb.append(lf); bb.append(lf);
while (iter.hasNext()) { while (iter.hasNext()) {
entry = (Map.Entry) iter.next(); entry = (Map.Entry) iter.next();
sb.append((String) entry.getKey()); bb.append((String) entry.getKey());
sb.append('='); bb.append('=');
sb.append((String) entry.getValue()); bb.append((String) entry.getValue());
sb.append(cr); bb.append(cr);
sb.append(lf); bb.append(lf);
} }
sb.append("# EOF"); bb.append("# EOF");
sb.append(cr); bb.append(cr);
sb.append(lf); bb.append(lf);
write(new String(sb).getBytes()); write(bb.getBytes());
} }
@ -263,7 +265,7 @@ abstract class kelondroAbstractRA implements kelondroRA {
} }
return map; return map;
} }
*/
/** /**
* this does not write the content to the see position * this does not write the content to the see position

Loading…
Cancel
Save