Renamed ChunkedInput.available to hasNextChunk

Renamed ChunkedInput.readChunk to nextChunk
This commit is contained in:
Trustin Lee 2009-06-19 09:04:36 +00:00
parent cd23da084a
commit cc0e6020d1
4 changed files with 9 additions and 9 deletions

View File

@ -91,7 +91,7 @@ public class ChunkedFile implements ChunkedInput {
return offset;
}
public boolean available() throws Exception {
public boolean hasNextChunk() throws Exception {
return offset < endOffset && file.getChannel().isOpen();
}
@ -99,7 +99,7 @@ public class ChunkedFile implements ChunkedInput {
file.close();
}
public Object readChunk() throws Exception {
public Object nextChunk() throws Exception {
long offset = this.offset;
if (offset >= endOffset) {
return null;

View File

@ -30,7 +30,7 @@ package org.jboss.netty.handler.stream;
* @version $Rev$, $Date$
*/
public interface ChunkedInput {
boolean available() throws Exception;
Object readChunk() throws Exception;
boolean hasNextChunk() throws Exception;
Object nextChunk() throws Exception;
void close() throws Exception;
}

View File

@ -66,7 +66,7 @@ public class ChunkedStream implements ChunkedInput {
return offset;
}
public boolean available() throws Exception {
public boolean hasNextChunk() throws Exception {
int b = in.read();
if (b < 0) {
return false;
@ -80,8 +80,8 @@ public class ChunkedStream implements ChunkedInput {
in.close();
}
public Object readChunk() throws Exception {
if (!available()) {
public Object nextChunk() throws Exception {
if (!hasNextChunk()) {
return null;
}

View File

@ -101,8 +101,8 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
Object chunk;
boolean last;
try {
chunk = chunks.readChunk();
last = !chunks.available();
chunk = chunks.nextChunk();
last = !chunks.hasNextChunk();
} catch (Throwable t) {
currentEvent.getFuture().setFailure(t);
fireExceptionCaught(ctx, t);