Fix checkstyle

This commit is contained in:
Norman Maurer 2012-06-10 20:45:38 +02:00
parent ad4f05f5d6
commit ed47feeed8
7 changed files with 9 additions and 17 deletions

View File

@ -143,14 +143,13 @@ public class ChunkedFile implements ChunkedByteInput {
}
int chunkSize = (int) Math.min(this.chunkSize, endOffset - offset);
// Check if the buffer is backed by an byte array. If so we can optimize it a bit an safe a copy
byte[] chunk = new byte[chunkSize];
file.readFully(chunk);
buffer.writeBytes(chunk);
this.offset = offset + chunkSize;
return true;
}
}

View File

@ -32,8 +32,7 @@ public interface ChunkedInput<B> {
* Releases the resources associated with the stream.
*/
void close() throws Exception;
/**
* Fetches a chunked data from the stream. The chunk is then
* transfered to the given buffer. Once this method returns the last chunk

View File

@ -19,7 +19,6 @@ import java.util.Queue;
/**
* {@link ChunkedInput} which reads its chunks and transfer it to a {@link Queue}
*
*
*/
public interface ChunkedMessageInput extends ChunkedInput<Queue<Object>> {

View File

@ -164,7 +164,7 @@ public class ChunkedNioFile implements ChunkedByteInput {
chunk.flip();
buffer.writeBytes(chunk);
this.offset += readBytes;
return true;
}
}

View File

@ -100,7 +100,6 @@ public class ChunkedNioStream implements ChunkedByteInput {
if (isEndOfInput()) {
return false;
}
// buffer cannot be not be empty from there
int readBytes = byteBuffer.position();
for (;;) {
@ -110,7 +109,6 @@ public class ChunkedNioStream implements ChunkedByteInput {
}
readBytes += localReadBytes;
offset += localReadBytes;
if (readBytes == chunkSize) {
break;
}
@ -118,7 +116,7 @@ public class ChunkedNioStream implements ChunkedByteInput {
byteBuffer.flip();
buffer.writeBytes(byteBuffer);
byteBuffer.clear();
return true;
}
}

View File

@ -105,9 +105,9 @@ public class ChunkedStream implements ChunkedByteInput {
} else {
chunkSize = Math.min(this.chunkSize, in.available());
}
// transfer to buffer
offset =+ buffer.writeBytes(in, chunkSize);
offset += buffer.writeBytes(in, chunkSize);
return true;
}
}

View File

@ -274,13 +274,10 @@ public class ChunkedWriteHandler
return;
}
}
}
/**
* Read the next {@link ChunkedInput} and transfer it the the outbound buffer.
*
* Read the next {@link ChunkedInput} and transfer it the the outbound buffer.
* @param ctx the {@link ChannelHandlerContext} this handler is bound to
* @param chunks the {@link ChunkedInput} to read from
* @return read <code>true</code> if something could be transfered to the outbound buffer
@ -295,7 +292,7 @@ public class ChunkedWriteHandler
throw new IllegalArgumentException("ChunkedInput instance " + chunks + " not supported");
}
}
static void closeInput(ChunkedInput<?> chunks) {
try {
chunks.close();