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 77import com .github .dockerjava .api .model .Frame ;
88import com .github .dockerjava .api .model .StreamType ;
99
10+ import javax .annotation .CheckForNull ;
11+
1012/**
1113 * Breaks the input into frame. Similar to how a buffered reader would readLies.
1214 * <p/>
@@ -42,14 +44,16 @@ private static StreamType streamType(byte streamType) {
4244 /**
4345 * @return A frame, or null if no more frames.
4446 */
47+ @ CheckForNull
4548 public Frame readFrame () throws IOException {
4649
4750 if (rawStreamDetected ) {
48-
4951 int read = inputStream .read (rawBuffer );
50-
52+ if (read == -1 ) {
53+ return null ;
54+ }
55+
5156 return new Frame (StreamType .RAW , Arrays .copyOf (rawBuffer , read ));
52-
5357 } else {
5458
5559 byte [] header = new byte [HEADER_SIZE ];
You can’t perform that action at this time.
0 commit comments