### Eclipse Workspace Patch 1.0
#P lucene
Index: lucene/src/java/org/apache/lucene/index/IOContext.java
===================================================================
--- lucene/src/java/org/apache/lucene/index/IOContext.java	(revision 0)
+++ lucene/src/java/org/apache/lucene/index/IOContext.java	(revision 0)
@@ -0,0 +1,59 @@
+package org.apache.lucene.index;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+IOContext holds additional details on the merge/search context.
+ */
+public class IOContext {
+  
+  public enum Context {Default,Merge,Search};
+  
+  public final Context context;
+  public final int bufferSize;
+  public final boolean DIRECT;
+  public final boolean SEQUENTIAL;  
+  
+  private static final IOContext DEFAULT_IOCONTEXT =
+    new IOContext(Context.Default, 4096, false, false);
+  
+  private IOContext(Context c, int bufferSize, boolean direct, boolean seq) {
+    this.context=c;
+    this.bufferSize = bufferSize;
+    this.DIRECT=direct;
+    this.SEQUENTIAL=seq;
+  }
+  
+  public static IOContext getDefaultContext() {
+    return DEFAULT_IOCONTEXT;
+  }
+  
+  public IOContext MergeIOContext(Context c,int bufferSize) {
+    if (c==Context.Merge) {
+      return new IOContext(Context.Merge,Math.max(bufferSize,4096),false,true);
+    }
+    return this;
+  }
+
+  public IOContext SearchIOContext(Context c,int bufferSize) {
+    if (c==Context.Search) {
+      return new IOContext(Context.Search,Math.max(bufferSize,4096),true,false);
+    }
+    return this;
+  }
+}
\ No newline at end of file
