Skip to content

Commit b3dd989

Browse files
committed
Rename SimpleFeedableBodyGenerator.BodyPart into BodyChunk
1 parent 2a8e147 commit b3dd989

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

client/src/main/java/org/asynchttpclient/request/body/generator/SimpleFeedableBodyGenerator.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.asynchttpclient.request.body.Body;
2424

2525
public final class SimpleFeedableBodyGenerator implements FeedableBodyGenerator, BodyGenerator {
26-
private final Queue<BodyPart> queue = new ConcurrentLinkedQueue<>();
26+
private final Queue<BodyChunk> queue = new ConcurrentLinkedQueue<>();
2727
private FeedListener listener;
2828

2929
@Override
@@ -33,7 +33,7 @@ public Body createBody() {
3333

3434
@Override
3535
public void feed(final ByteBuffer buffer, final boolean isLast) {
36-
queue.offer(new BodyPart(buffer, isLast));
36+
queue.offer(new BodyChunk(buffer, isLast));
3737
if (listener != null) {
3838
listener.onContentAdded();
3939
}
@@ -57,18 +57,18 @@ public long getContentLength() {
5757
public BodyState transferTo(final ByteBuf target) throws IOException {
5858
switch (state) {
5959
case CONTINUE:
60-
return readNextPart(target);
60+
return readNextChunk(target);
6161
case STOP:
6262
return BodyState.STOP;
6363
default:
6464
throw new IllegalStateException("Illegal process state.");
6565
}
6666
}
6767

68-
private BodyState readNextPart(ByteBuf target) throws IOException {
68+
private BodyState readNextChunk(ByteBuf target) throws IOException {
6969
BodyState res = BodyState.SUSPEND;
7070
while (target.isWritable() && state != BodyState.STOP) {
71-
BodyPart nextPart = queue.peek();
71+
BodyChunk nextPart = queue.peek();
7272
if (nextPart == null) {
7373
// Nothing in the queue. suspend stream if nothing was read. (reads == 0)
7474
return res;
@@ -77,13 +77,13 @@ private BodyState readNextPart(ByteBuf target) throws IOException {
7777
queue.remove();
7878
} else {
7979
res = BodyState.CONTINUE;
80-
readBodyPart(target, nextPart);
80+
readBodyChunk(target, nextPart);
8181
}
8282
}
8383
return res;
8484
}
8585

86-
private void readBodyPart(ByteBuf target, BodyPart part) {
86+
private void readBodyChunk(ByteBuf target, BodyChunk part) {
8787
move(target, part.buffer);
8888

8989
if (!part.buffer.hasRemaining()) {
@@ -109,11 +109,11 @@ private void move(ByteBuf target, ByteBuffer source) {
109109
}
110110
}
111111

112-
private final class BodyPart {
112+
private final class BodyChunk {
113113
private final boolean isLast;
114114
private final ByteBuffer buffer;
115115

116-
public BodyPart(final ByteBuffer buffer, final boolean isLast) {
116+
public BodyChunk(final ByteBuffer buffer, final boolean isLast) {
117117
this.buffer = buffer;
118118
this.isLast = isLast;
119119
}

0 commit comments

Comments
 (0)