Renamed ChunkedFile to ChunkedOioFile. ChunkedFile will be added again as an interface
This commit is contained in:
parent
d9de1675d0
commit
c7179aa28a
@ -40,7 +40,7 @@ import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
|
||||
import org.jboss.netty.handler.codec.http.HttpRequest;
|
||||
import org.jboss.netty.handler.codec.http.HttpResponse;
|
||||
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
|
||||
import org.jboss.netty.handler.stream.ChunkedFile;
|
||||
import org.jboss.netty.handler.stream.ChunkedOioFile;
|
||||
import org.jboss.netty.util.CharsetUtil;
|
||||
|
||||
/**
|
||||
@ -91,7 +91,7 @@ public class HttpStaticFileServerHandler extends SimpleChannelUpstreamHandler {
|
||||
ch.write(response);
|
||||
|
||||
// Write the content.
|
||||
ChannelFuture writeFuture = ch.write(new ChunkedFile(raf, 0, fileLength, 8192));
|
||||
ChannelFuture writeFuture = ch.write(new ChunkedOioFile(raf, 0, fileLength, 8192));
|
||||
|
||||
// Decide whether to close the connection or not.
|
||||
if (!isKeepAlive(request)) {
|
||||
|
@ -28,7 +28,7 @@ import java.io.RandomAccessFile;
|
||||
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
|
||||
* @version $Rev$, $Date$
|
||||
*/
|
||||
public class ChunkedFile implements ChunkedInput {
|
||||
public class ChunkedOioFile implements ChunkedInput {
|
||||
|
||||
private final RandomAccessFile file;
|
||||
private final long startOffset;
|
||||
@ -39,7 +39,7 @@ public class ChunkedFile implements ChunkedInput {
|
||||
/**
|
||||
* Creates a new instance that fetches data from the specified file.
|
||||
*/
|
||||
public ChunkedFile(File file) throws IOException {
|
||||
public ChunkedOioFile(File file) throws IOException {
|
||||
this(file, ChunkedStream.DEFAULT_CHUNK_SIZE);
|
||||
}
|
||||
|
||||
@ -49,14 +49,14 @@ public class ChunkedFile implements ChunkedInput {
|
||||
* @param chunkSize the number of bytes to fetch on each
|
||||
* {@link #nextChunk()} call
|
||||
*/
|
||||
public ChunkedFile(File file, int chunkSize) throws IOException {
|
||||
public ChunkedOioFile(File file, int chunkSize) throws IOException {
|
||||
this(new RandomAccessFile(file, "r"), chunkSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance that fetches data from the specified file.
|
||||
*/
|
||||
public ChunkedFile(RandomAccessFile file) throws IOException {
|
||||
public ChunkedOioFile(RandomAccessFile file) throws IOException {
|
||||
this(file, ChunkedStream.DEFAULT_CHUNK_SIZE);
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public class ChunkedFile implements ChunkedInput {
|
||||
* @param chunkSize the number of bytes to fetch on each
|
||||
* {@link #nextChunk()} call
|
||||
*/
|
||||
public ChunkedFile(RandomAccessFile file, int chunkSize) throws IOException {
|
||||
public ChunkedOioFile(RandomAccessFile file, int chunkSize) throws IOException {
|
||||
this(file, 0, file.length(), chunkSize);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public class ChunkedFile implements ChunkedInput {
|
||||
* @param chunkSize the number of bytes to fetch on each
|
||||
* {@link #nextChunk()} call
|
||||
*/
|
||||
public ChunkedFile(RandomAccessFile file, long offset, long length, int chunkSize) throws IOException {
|
||||
public ChunkedOioFile(RandomAccessFile file, long offset, long length, int chunkSize) throws IOException {
|
||||
if (file == null) {
|
||||
throw new NullPointerException("file");
|
||||
}
|
@ -56,7 +56,7 @@ import org.jboss.netty.util.internal.LinkedTransferQueue;
|
||||
* stream chunk by chunk and write the fetched chunk downstream:
|
||||
* <pre>
|
||||
* {@link Channel} ch = ...;
|
||||
* ch.write(new {@link ChunkedFile}(new File("video.mkv"));
|
||||
* ch.write(new {@link ChunkedOioFile}(new File("video.mkv"));
|
||||
* </pre>
|
||||
*
|
||||
* <h3>Sending a stream which generates a chunk intermittently</h3>
|
||||
|
Loading…
Reference in New Issue
Block a user