Skip to content

Commit

Permalink
bugfix in kelondroRA (hint by Martin)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@847 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Oct 4, 2005
1 parent 0c3a20d commit 5dc0d41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions source/de/anomic/kelondro/kelondroFileRA.java
Expand Up @@ -78,8 +78,7 @@ private void sync() throws IOException {

// pseudo-native method read
public int read() throws IOException {
//sync();
return RAFile.read();
return RAFile.read();
}

// pseudo-native method write
Expand All @@ -88,9 +87,7 @@ public void write(int b) throws IOException {
}

public int read(byte[] b, int off, int len) throws IOException {
//sync();
RAFile.read(b, off, len);
return len;
return RAFile.read(b, off, len);
}

public void write(byte[] b, int off, int len) throws IOException {
Expand All @@ -103,7 +100,6 @@ public void seek(long pos) throws IOException {
}

public void close() throws IOException {
//sync();
RAFile.close();
RAFile = null;
}
Expand Down
6 changes: 3 additions & 3 deletions source/de/anomic/kelondro/kelondroRecords.java
Expand Up @@ -303,7 +303,7 @@ private void init(kelondroRA ra) throws IOException {
for (int i = 0; i < TXTPROPS.length; i++) {
entryFile.seek(POS_TXTPROPS + TXTPROPW * i);
TXTPROPS[i] = new byte[TXTPROPW];
entryFile.read(TXTPROPS[i], 0, TXTPROPS[i].length);
entryFile.readFully(TXTPROPS[i], 0, TXTPROPS[i].length);
}

// assign remaining values that are only present at run-time
Expand Down Expand Up @@ -526,7 +526,7 @@ private void initContent() throws IOException {
synchronized (entryFile) {
entryFile.seek(seekpos(this.handle));
entryFile.readFully(this.headChunk, 0, this.headChunk.length);
//entryFile.read(this.tailChunk, 0, this.tailChunk.length);
//entryFile.readFully(this.tailChunk, 0, this.tailChunk.length);
}
this.headChanged = true; // provoke a cache store
cp = CP_HIGH;
Expand Down Expand Up @@ -630,7 +630,7 @@ public byte[][] getValues() throws IOException {
// read values
synchronized (entryFile) {
entryFile.seek(seekpos(this.handle) + headchunksize);
entryFile.read(this.tailChunk, 0, this.tailChunk.length);
entryFile.readFully(this.tailChunk, 0, this.tailChunk.length);
}
}

Expand Down

0 comments on commit 5dc0d41

Please sign in to comment.