diff --git a/lucene/core/src/java/org/apache/lucene/store/BufferedIndexOutput.java b/lucene/core/src/java/org/apache/lucene/store/BufferedIndexOutput.java
index bc852b3..2f53c97 100644
--- a/lucene/core/src/java/org/apache/lucene/store/BufferedIndexOutput.java
+++ b/lucene/core/src/java/org/apache/lucene/store/BufferedIndexOutput.java
@@ -21,33 +21,66 @@ import java.io.IOException;
 
 /** Base implementation class for buffered {@link IndexOutput}. */
 public abstract class BufferedIndexOutput extends IndexOutput {
-  static final int BUFFER_SIZE = 16384;
+  
+  /**
+   * Default output buffer size. Default value is: {@value #DEFAULT_BUFFER_SIZE} byte
+   */
+  public static final int DEFAULT_BUFFER_SIZE = 16384;
+  protected final int bufferSize;
 
-  private final byte[] buffer = new byte[BUFFER_SIZE];
+  private final byte[] buffer;
   private long bufferStart = 0;           // position in file of buffer
   private int bufferPosition = 0;         // position in buffer
+  
+  /**
+   * Creates a new {@link BufferedIndexOutput} with the
+   * {@value #DEFAULT_BUFFER_SIZE default buffer size} in bytes.
+   */
+  protected BufferedIndexOutput() {
+    this(DEFAULT_BUFFER_SIZE);
+  }
+  
+  /**
+   * <b>Expert:</b> Creates a new {@link BufferedIndexOutput} with the given buffer size in
+   * bytes.
+   * 
+   * @param bufferSize
+   *          buffer size in bytes
+   * @throws IllegalArgumentException
+   *           if the buffer size is less or equal to 0
+   */
+  protected BufferedIndexOutput(int bufferSize) {
+    checkBufferSize(bufferSize);
+    buffer = new byte[bufferSize];
+    this.bufferSize = bufferSize;
+  }
+  
+  private void checkBufferSize(int bufferSize) {
+    if (bufferSize <= 0)
+      throw new IllegalArgumentException("bufferSize must be greater than 0 (got " + bufferSize + ")");
+  }
 
   @Override
   public void writeByte(byte b) throws IOException {
-    if (bufferPosition >= BUFFER_SIZE)
+    if (bufferPosition >= bufferSize)
       flush();
     buffer[bufferPosition++] = b;
   }
 
   @Override
   public void writeBytes(byte[] b, int offset, int length) throws IOException {
-    int bytesLeft = BUFFER_SIZE - bufferPosition;
+    int bytesLeft = bufferSize - bufferPosition;
     // is there enough space in the buffer?
     if (bytesLeft >= length) {
       // we add the data to the end of the buffer
       System.arraycopy(b, offset, buffer, bufferPosition, length);
       bufferPosition += length;
       // if the buffer is full, flush it
-      if (BUFFER_SIZE - bufferPosition == 0)
+      if (bufferSize - bufferPosition == 0)
         flush();
     } else {
       // is data larger then buffer?
-      if (length > BUFFER_SIZE) {
+      if (length > bufferSize) {
         // we flush the buffer
         if (bufferPosition > 0)
           flush();
@@ -64,10 +97,10 @@ public abstract class BufferedIndexOutput extends IndexOutput {
           pos += pieceLength;
           bufferPosition += pieceLength;
           // if the buffer is full, flush it
-          bytesLeft = BUFFER_SIZE - bufferPosition;
+          bytesLeft = bufferSize - bufferPosition;
           if (bytesLeft == 0) {
             flush();
-            bytesLeft = BUFFER_SIZE;
+            bytesLeft = bufferSize;
           }
         }
       }
diff --git a/lucene/core/src/java/org/apache/lucene/store/RateLimitedDirectoryWrapper.java b/lucene/core/src/java/org/apache/lucene/store/RateLimitedDirectoryWrapper.java
index ffa7157..d3ecbe4 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RateLimitedDirectoryWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RateLimitedDirectoryWrapper.java
@@ -35,9 +35,33 @@ public final class RateLimitedDirectoryWrapper extends Directory {
   // / modified concurrently
   private volatile RateLimiter[] contextRateLimiters = new RateLimiter[IOContext.Context
       .values().length];
+  private final int bufferSize;
   
-  public RateLimitedDirectoryWrapper(Directory wrapped) {
-    this.delegate = wrapped;
+  /**
+   * Creates a new {@link RateLimitedDirectoryWrapper} rate limiting the given
+   * directories {@link IndexOutput}. The internal buffer size is set to
+   * {@value BufferedIndexOutput#DEFAULT_BUFFER_SIZE}.
+   * 
+   * @param delegate
+   *          the wrapped directory
+   */
+  public RateLimitedDirectoryWrapper(Directory delegate) {
+    this(delegate, BufferedIndexOutput.DEFAULT_BUFFER_SIZE);
+  }
+  
+  /**
+   * Creates a new {@link RateLimitedDirectoryWrapper} rate limiting the given
+   * directories {@link IndexOutput}.
+   * 
+   * @param delegate
+   *          the wrapped directory
+   * @param rateLimitBufferSize
+   *          the buffer size used to buffer bytes in memory before flushing to
+   *          disk
+   */
+  public RateLimitedDirectoryWrapper(Directory delegate, int rateLimitBufferSize ) {
+    this.delegate = delegate;
+    this.bufferSize = rateLimitBufferSize;
   }
   
   public String[] listAll() throws IOException {
@@ -66,7 +90,7 @@ public final class RateLimitedDirectoryWrapper extends Directory {
     final IndexOutput output = delegate.createOutput(name, context);
     final RateLimiter limiter = getRateLimiter(context.context);
     if (limiter != null) {
-      return new RateLimitedIndexOutput(limiter, output);
+      return new RateLimitedIndexOutput(limiter, output, bufferSize);
     }
     return output;
   }
diff --git a/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java b/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
index db74220..6d2c8fb 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
@@ -29,6 +29,10 @@ final class RateLimitedIndexOutput extends BufferedIndexOutput {
   private final RateLimiter rateLimiter;
 
   RateLimitedIndexOutput(final RateLimiter rateLimiter, final IndexOutput delegate) {
+    this(rateLimiter, delegate, DEFAULT_BUFFER_SIZE);
+  }
+  RateLimitedIndexOutput(final RateLimiter rateLimiter, final IndexOutput delegate, final int bufferSize) {
+    super(bufferSize);
     // TODO should we make buffer size configurable
     if (delegate instanceof BufferedIndexOutput) {
       bufferedDelegate = (BufferedIndexOutput) delegate;
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index 4cf82a8..073b14f 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -949,12 +949,18 @@ public abstract class LuceneTestCase extends Assert {
       directory = new NRTCachingDirectory(directory, random.nextDouble(), random.nextDouble());
     }
     
-    if (rarely(random)) { 
+    if (rarely(random) || true) { 
       final double maxMBPerSec = 10 + 5*(random.nextDouble()-0.5);
       if (LuceneTestCase.VERBOSE) {
         System.out.println("LuceneTestCase: will rate limit output IndexOutput to " + maxMBPerSec + " MB/sec");
       }
-      final RateLimitedDirectoryWrapper rateLimitedDirectoryWrapper = new RateLimitedDirectoryWrapper(directory);
+      final int bufferSize;
+      if (rarely()) {
+        bufferSize = 1 + random().nextInt(BufferedIndexOutput.DEFAULT_BUFFER_SIZE);
+      } else {
+        bufferSize = 1 << (10 + random().nextInt(6));
+      }
+      final RateLimitedDirectoryWrapper rateLimitedDirectoryWrapper = new RateLimitedDirectoryWrapper(directory, bufferSize);
       switch (random.nextInt(10)) {
         case 3: // sometimes rate limit on flush
           rateLimitedDirectoryWrapper.setMaxWriteMBPerSec(maxMBPerSec, Context.FLUSH);
