diff --git a/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java b/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java
index ff963f2..3f3ab3e 100644
--- a/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java
+++ b/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java
@@ -220,11 +220,14 @@ public class HttpResponse implements Response {
         throw new HttpException("bad content length: "+contentLengthString);
       }
     }
-    if (http.getMaxContent() >= 0
-      && contentLength > http.getMaxContent())   // limit download size
-      contentLength  = http.getMaxContent();
-
     ByteArrayOutputStream out = new ByteArrayOutputStream(Http.BUFFER_SIZE);
+    if (http.getMaxContent() >= 0
+      && contentLength > http.getMaxContent()){   // limit download size
+      // If file size bigger then limit size, it writes null content. 
+      //contentLength  = http.getMaxContent();
+      content = out.toByteArray();
+      return;
+    }
     byte[] bytes = new byte[Http.BUFFER_SIZE];
     int length = 0;                           // read content
     for (int i = in.read(bytes); i != -1 && length + i <= contentLength; i = in.read(bytes)) {
