File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/java/com/github/dockerjava/core/command Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 7
7
import com .github .dockerjava .api .model .Frame ;
8
8
import com .github .dockerjava .api .model .StreamType ;
9
9
10
+ import javax .annotation .CheckForNull ;
11
+
10
12
/**
11
13
* Breaks the input into frame. Similar to how a buffered reader would readLies.
12
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.
44
46
*/
47
+ @ CheckForNull
45
48
public Frame readFrame () throws IOException {
46
49
47
50
if (rawStreamDetected ) {
48
-
49
51
int read = inputStream .read (rawBuffer );
50
-
52
+ if (read == -1 ) {
53
+ return null ;
54
+ }
55
+
51
56
return new Frame (StreamType .RAW , Arrays .copyOf (rawBuffer , read ));
52
-
53
57
} else {
54
58
55
59
byte [] header = new byte [HEADER_SIZE ];
You can’t perform that action at this time.
0 commit comments