示例#1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public synchronized void close() throws java.io.IOException
            public override void close()
            {
                lock (this)
                {
                    // NOTE: we synchronize and track "isOpen" because Lucene sometimes closes IIs twice!
                    if (!isClone && isOpen)
                    {
                        WindowsDirectory.close(fd);
                        isOpen = false;
                    }
                }
            }
示例#2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void readInternal(byte[] b, int offset, int length) throws java.io.IOException
            protected internal override void readInternal(sbyte[] b, int offset, int length)
            {
                int bytesRead;

                try
                {
                    bytesRead = WindowsDirectory.read(fd, b, offset, length, FilePointer);
                }
                catch (IOException ioe)
                {
                    throw new IOException(ioe.Message + ": " + this, ioe);
                }

                if (bytesRead != length)
                {
                    throw new EOFException("read past EOF: " + this);
                }
            }
示例#3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public WindowsIndexInput(java.io.File file, int bufferSize) throws java.io.IOException
            public WindowsIndexInput(File file, int bufferSize) : base("WindowsIndexInput(path=\"" + file.Path + "\")", bufferSize)
            {
                fd             = WindowsDirectory.open(file.Path);
                length_Renamed = WindowsDirectory.length(fd);
                isOpen         = true;
            }