BufferSize() 공개 정적인 메소드

Returns default buffer sizes for the given IOContext
public static BufferSize ( IOContext context ) : int
context IOContext
리턴 int
예제 #1
0
 /// <summary>
 /// Create a new CompoundFileDirectory.
 /// </summary>
 public CompoundFileDirectory(Directory directory, string fileName, IOContext context, bool openForWrite)
 {
     this.Directory_Renamed = directory;
     this.FileName          = fileName;
     this.ReadBufferSize    = BufferedIndexInput.BufferSize(context);
     this.isOpen            = false;
     this.OpenForWrite      = openForWrite;
     if (!openForWrite)
     {
         bool success = false;
         Handle = directory.CreateSlicer(fileName, context);
         try
         {
             this.Entries = ReadEntries(Handle, directory, fileName);
             success      = true;
         }
         finally
         {
             if (!success)
             {
                 IOUtils.CloseWhileHandlingException(Handle);
             }
         }
         this.isOpen = true;
         Writer      = null;
     }
     else
     {
         Debug.Assert(!(directory is CompoundFileDirectory), "compound file inside of compound file: " + fileName);
         this.Entries = SENTINEL;
         this.isOpen  = true;
         Writer       = new CompoundFileWriter(directory, fileName);
         Handle       = null;
     }
 }
예제 #2
0
 public override IndexInput OpenSlice(string sliceDescription, long offset, long length)
 {
     return(new SimpleFSIndexInput("SimpleFSIndexInput(" + sliceDescription + " in path=\"" + File.FullName + "\" slice=" + offset + ":" + (offset + length) + ")", Descriptor, offset, length, BufferedIndexInput.BufferSize(Context)));
 }