Lines 44-51
Link Here
|
44 |
private byte[] streamBuffer; |
44 |
private byte[] streamBuffer; |
45 |
private int bufferIndex, bufferEnd; // used when reading from the file into the streamBuffer |
45 |
private int bufferIndex, bufferEnd; // used when reading from the file into the streamBuffer |
46 |
private int streamEnd; // used when writing data from the streamBuffer to the file |
46 |
private int streamEnd; // used when writing data from the streamBuffer to the file |
|
|
47 |
char separator = Index.DEFAULT_SEPARATOR; |
47 |
|
48 |
|
48 |
public static final String SIGNATURE= "INDEX VERSION 1.122"; //$NON-NLS-1$ |
49 |
public static final String SIGNATURE= "INDEX VERSION 1.123"; //$NON-NLS-1$ |
49 |
private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray(); |
50 |
private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray(); |
50 |
public static boolean DEBUG = false; |
51 |
public static boolean DEBUG = false; |
51 |
|
52 |
|
Lines 423-428
Link Here
|
423 |
this.categoryOffsets = new HashtableOfIntValues(size); |
424 |
this.categoryOffsets = new HashtableOfIntValues(size); |
424 |
this.categoryEnds = new HashtableOfIntValues(size); |
425 |
this.categoryEnds = new HashtableOfIntValues(size); |
425 |
this.categoryTables = new HashtableOfObject(size); |
426 |
this.categoryTables = new HashtableOfObject(size); |
|
|
427 |
this.separator = diskIndex.separator; |
426 |
} |
428 |
} |
427 |
private void mergeCategories(DiskIndex onDisk, int[] positions, FileOutputStream stream) throws IOException { |
429 |
private void mergeCategories(DiskIndex onDisk, int[] positions, FileOutputStream stream) throws IOException { |
428 |
// at this point, this.categoryTables contains the names -> wordsToDocs added in copyQueryResults() |
430 |
// at this point, this.categoryTables contains the names -> wordsToDocs added in copyQueryResults() |
Lines 770-775
Link Here
|
770 |
this.numberOfChunks = readStreamInt(stream); |
772 |
this.numberOfChunks = readStreamInt(stream); |
771 |
this.sizeOfLastChunk = this.streamBuffer[this.bufferIndex++] & 0xFF; |
773 |
this.sizeOfLastChunk = this.streamBuffer[this.bufferIndex++] & 0xFF; |
772 |
this.documentReferenceSize = this.streamBuffer[this.bufferIndex++] & 0xFF; |
774 |
this.documentReferenceSize = this.streamBuffer[this.bufferIndex++] & 0xFF; |
|
|
775 |
this.separator = (char) (this.streamBuffer[this.bufferIndex++] & 0xFF); |
773 |
|
776 |
|
774 |
this.chunkOffsets = new int[this.numberOfChunks]; |
777 |
this.chunkOffsets = new int[this.numberOfChunks]; |
775 |
for (int i = 0; i < this.numberOfChunks; i++) |
778 |
for (int i = 0; i < this.numberOfChunks; i++) |
Lines 1123-1135
Link Here
|
1123 |
} |
1126 |
} |
1124 |
private void writeHeaderInfo(FileOutputStream stream) throws IOException { |
1127 |
private void writeHeaderInfo(FileOutputStream stream) throws IOException { |
1125 |
writeStreamInt(stream, this.numberOfChunks); |
1128 |
writeStreamInt(stream, this.numberOfChunks); |
1126 |
if ((this.bufferIndex + 2) >= BUFFER_WRITE_SIZE) { |
1129 |
if ((this.bufferIndex + 3) >= BUFFER_WRITE_SIZE) { |
1127 |
stream.write(this.streamBuffer, 0, this.bufferIndex); |
1130 |
stream.write(this.streamBuffer, 0, this.bufferIndex); |
1128 |
this.bufferIndex = 0; |
1131 |
this.bufferIndex = 0; |
1129 |
} |
1132 |
} |
1130 |
this.streamBuffer[this.bufferIndex++] = (byte) this.sizeOfLastChunk; |
1133 |
this.streamBuffer[this.bufferIndex++] = (byte) this.sizeOfLastChunk; |
1131 |
this.streamBuffer[this.bufferIndex++] = (byte) this.documentReferenceSize; |
1134 |
this.streamBuffer[this.bufferIndex++] = (byte) this.documentReferenceSize; |
1132 |
this.streamEnd += 2; |
1135 |
this.streamBuffer[this.bufferIndex++] = (byte) this.separator; |
|
|
1136 |
this.streamEnd += 3; |
1133 |
|
1137 |
|
1134 |
// apend the file with chunk offsets |
1138 |
// apend the file with chunk offsets |
1135 |
for (int i = 0; i < this.numberOfChunks; i++) { |
1139 |
for (int i = 0; i < this.numberOfChunks; i++) { |