We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19a3b3c commit a1e8bc7Copy full SHA for a1e8bc7
1 file changed
src/main/java/com/github/dockerjava/core/command/FrameReader.java
@@ -7,6 +7,8 @@
7
import com.github.dockerjava.api.model.Frame;
8
import com.github.dockerjava.api.model.StreamType;
9
10
+import javax.annotation.CheckForNull;
11
+
12
/**
13
* Breaks the input into frame. Similar to how a buffered reader would readLies.
14
* <p/>
@@ -42,14 +44,16 @@ private static StreamType streamType(byte streamType) {
42
44
43
45
* @return A frame, or null if no more frames.
46
*/
47
+ @CheckForNull
48
public Frame readFrame() throws IOException {
49
50
if (rawStreamDetected) {
-
51
int read = inputStream.read(rawBuffer);
52
+ if (read == -1) {
53
+ return null;
54
+ }
55
56
return new Frame(StreamType.RAW, Arrays.copyOf(rawBuffer, read));
57
} else {
58
59
byte[] header = new byte[HEADER_SIZE];
0 commit comments