diff --git oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarEntry.java oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarEntry.java
index 7b11979..788d834 100644
--- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarEntry.java
+++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarEntry.java
@@ -81,4 +81,27 @@ class TarEntry {
         return size;
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        TarEntry tarEntry = (TarEntry) o;
+
+        if (lsb != tarEntry.lsb) return false;
+        if (msb != tarEntry.msb) return false;
+        if (offset != tarEntry.offset) return false;
+        if (size != tarEntry.size) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) (msb ^ (msb >>> 32));
+        result = 31 * result + (int) (lsb ^ (lsb >>> 32));
+        result = 31 * result + offset;
+        result = 31 * result + size;
+        return result;
+    }
 }
diff --git oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarWriter.java oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarWriter.java
index d87461a..cc4c7bf 100644
--- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarWriter.java
+++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarWriter.java
@@ -26,10 +26,11 @@ import static com.google.common.collect.Sets.newHashSet;
 import static org.apache.jackrabbit.oak.plugins.segment.Segment.REF_COUNT_OFFSET;
 import static org.apache.jackrabbit.oak.plugins.segment.SegmentId.isDataSegmentId;
 
+import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileDescriptor;
+import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.Collections;
@@ -40,6 +41,7 @@ import java.util.SortedMap;
 import java.util.UUID;
 import java.util.zip.CRC32;
 
+import com.google.common.io.CountingOutputStream;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,7 +88,8 @@ class TarWriter {
      * an extra empty file when just reading from the repository.
      * Should only be accessed from synchronized code.
      */
-    private RandomAccessFile access = null;
+    private CountingOutputStream access = null;
+    private FileOutputStream fileOutputStream = null;
 
     /**
      * Flag to indicate a closed writer. Accessing a closed writer is illegal.
@@ -107,6 +110,8 @@ class TarWriter {
 
     private final SortedMap<UUID, List<UUID>> graph = newTreeMap();
 
+    private final Map<TarEntry, ByteBuffer> currentEntries = newHashMap();
+
     TarWriter(File file) {
         this.file = file;
     }
@@ -125,11 +130,8 @@ class TarWriter {
         TarEntry entry = index.get(new UUID(msb, lsb));
         if (entry != null) {
             checkState(access != null); // implied by entry != null
-            ByteBuffer data = ByteBuffer.allocate(entry.size());
-            access.seek(entry.offset());
-            access.readFully(data.array());
-            access.seek(access.length());
-            return data;
+            ByteBuffer data = currentEntries.get(entry);
+            return data.duplicate().asReadOnlyBuffer();
         } else {
             return null;
         }
@@ -156,7 +158,8 @@ class TarWriter {
             throws IOException {
         checkState(!closed);
         if (access == null) {
-            access = new RandomAccessFile(file, "rw");
+            fileOutputStream = new FileOutputStream(file);
+            access = new CountingOutputStream(new BufferedOutputStream(fileOutputStream));
         }
 
         access.write(header);
@@ -166,12 +169,13 @@ class TarWriter {
             access.write(ZERO_BYTES, 0, padding);
         }
 
-        long length = access.getFilePointer();
+        long length = access.getCount();
         checkState(length <= Integer.MAX_VALUE);
         TarEntry entry = new TarEntry(
                 uuid.getMostSignificantBits(), uuid.getLeastSignificantBits(),
                 (int) (length - size - padding), size);
         index.put(uuid, entry);
+        currentEntries.put(entry, ByteBuffer.wrap(data));
 
         if (isDataSegmentId(uuid.getLeastSignificantBits())) {
             ByteBuffer segment = ByteBuffer.wrap(data, offset, size);
@@ -212,7 +216,8 @@ class TarWriter {
 
             synchronized (this) {
                 if (access != null && !closed) {
-                    descriptor = access.getFD();
+                    access.flush();
+                    descriptor = fileOutputStream.getFD();
                 }
             }
 
@@ -250,6 +255,7 @@ class TarWriter {
             writeIndex();
             access.write(ZERO_BYTES);
             access.write(ZERO_BYTES);
+            access.flush();
             access.close();
         }
     }
