Index: lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java
===================================================================
--- lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java	(revision 1140463)
+++ lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java	(working copy)
@@ -124,16 +124,18 @@
   public static class Reader extends BytesReaderBase {
     private final int size;
     private final int maxDoc;
+    private final boolean fitsInOneArray;
 
     Reader(Directory dir, String id, int maxDoc) throws IOException {
       super(dir, id, CODEC_NAME, VERSION_START, false);
       size = datIn.readInt();
       this.maxDoc = maxDoc;
+      fitsInOneArray = ((long)size * (long)maxDoc) <= Integer.MAX_VALUE;
     }
 
     @Override
     public Source load() throws IOException {
-      return size == 1 ? new SingleByteSource(cloneData(), maxDoc) : 
+      return fitsInOneArray ? new StraightArrayByteSource(cloneData(), maxDoc, size) : 
         new StraightBytesSource(cloneData(), size, maxDoc);
     }
 
@@ -142,15 +144,17 @@
       datIn.close();
     }
     
-    // specialized version for single bytes
-    private static class SingleByteSource extends Source {
+    // specialized version if all bytes fit in one array bytes
+    private static class StraightArrayByteSource extends Source {
       private final int maxDoc;
       private final byte[] data;
+      private final int sizePerDoc;
 
-      public SingleByteSource(IndexInput datIn, int maxDoc) throws IOException {
+      public StraightArrayByteSource(IndexInput datIn, int maxDoc, int sizePerDoc) throws IOException {
         this.maxDoc = maxDoc;
+        this.sizePerDoc = sizePerDoc;
         try {
-          data = new byte[maxDoc];
+          data = new byte[maxDoc * sizePerDoc];
           datIn.readBytes(data, 0, data.length, false);
         } finally {
           IOUtils.closeSafely(false, datIn);
@@ -160,9 +164,9 @@
 
       @Override
       public BytesRef getBytes(int docID, BytesRef bytesRef) {
-        bytesRef.length = 1;
+        bytesRef.length = sizePerDoc;
         bytesRef.bytes = data;
-        bytesRef.offset = docID;
+        bytesRef.offset = sizePerDoc*docID;
         return bytesRef;
       }
       
@@ -179,14 +183,23 @@
             if (target >= numDocs) {
               return pos = NO_MORE_DOCS;
             }
-            bytesRef.length = 1;
+            bytesRef.length = sizePerDoc;
             bytesRef.bytes = data;
-            bytesRef.offset = target;
+            bytesRef.offset = sizePerDoc*target;
             return pos = target;
           }
         };
       }
 
+      @Override
+      public boolean hasArray() {
+        return true;
+      }
+
+      @Override
+      public Object getArray() {
+        return data;
+      }
     }
 
     private static class StraightBytesSource extends BytesBaseSource {
