Fix checkstyle
This commit is contained in:
parent
ad4f05f5d6
commit
ed47feeed8
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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>> {
|
||||
|
@ -164,7 +164,7 @@ public class ChunkedNioFile implements ChunkedByteInput {
|
||||
chunk.flip();
|
||||
buffer.writeBytes(chunk);
|
||||
this.offset += readBytes;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user