You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/03/21 13:51:45 UTC
svn commit: r756927 [4/4] - in
/incubator/lucene.net/trunk/C#/src/Lucene.Net: ./ Analysis/Standard/ Index/
Store/
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/BufferedIndexInput.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/BufferedIndexInput.cs?rev=756927&r1=756926&r2=756927&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/BufferedIndexInput.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/BufferedIndexInput.cs Sat Mar 21 12:51:41 2009
@@ -165,11 +165,10 @@
{
long start = bufferStart + bufferPosition;
long end = start + bufferSize;
- if (end > Length())
- // don't read past EOF
+ if (end > Length()) // don't read past EOF
end = Length();
- bufferLength = (int) (end - start);
- if (bufferLength <= 0)
+ int newLength = (int)(end - start);
+ if (newLength <= 0)
throw new System.IO.IOException("read past EOF");
if (buffer == null)
@@ -177,8 +176,9 @@
buffer = new byte[bufferSize]; // allocate buffer lazily
SeekInternal(bufferStart);
}
- ReadInternal(buffer, 0, bufferLength);
-
+
+ ReadInternal(buffer, 0, newLength);
+ bufferLength = newLength;
bufferStart = start;
bufferPosition = 0;
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/FSDirectory.cs?rev=756927&r1=756926&r2=756927&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs Sat Mar 21 12:51:41 2009
@@ -604,19 +604,19 @@
return new FSIndexOutput(file);
}
-
- // Inherit javadoc
- public override IndexInput OpenInput(System.String name)
- {
- return new FSIndexInput(new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name)));
- }
-
- // Inherit javadoc
- public override IndexInput OpenInput(System.String name, int bufferSize)
- {
- return new FSIndexInput(new System.IO.FileInfo(directory.FullName + System.IO.Path.DirectorySeparatorChar + name), bufferSize);
- }
-
+
+ // Inherit javadoc
+ public override IndexInput OpenInput(System.String name)
+ {
+ return OpenInput(name, BufferedIndexInput.BUFFER_SIZE);
+ }
+
+ // Inherit javadoc
+ public override IndexInput OpenInput(System.String name, int bufferSize)
+ {
+ return new FSIndexInput(new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name)), bufferSize);
+ }
+
/// <summary> So we can do some byte-to-hexchar conversion below</summary>
private static readonly char[] HEX_DIGITS = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};