Java Code Examples for com.github.dockerjava.api.model.Frame#getStreamType()
The following examples show how to use
com.github.dockerjava.api.model.Frame#getStreamType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FrameConsumerResultCallback.java From testcontainers-java with MIT License | 6 votes |
@Override public void onNext(Frame frame) { if (frame != null) { OutputFrame outputFrame = OutputFrame.forFrame(frame); if (outputFrame != null) { Consumer<OutputFrame> consumer = consumers.get(outputFrame.getType()); if (consumer == null) { LOGGER.error("got frame with type {}, for which no handler is configured", frame.getStreamType()); } else if (outputFrame.getBytes() != null && outputFrame.getBytes().length > 0) { if (frame.getStreamType() == StreamType.RAW) { processRawFrame(outputFrame, consumer); } else { processOtherFrame(outputFrame, consumer); } } } } }
Example 2
Source File: ExecStartResultCallback.java From docker-java with Apache License 2.0 | 5 votes |
@Override public void onNext(Frame frame) { if (frame != null) { try { switch (frame.getStreamType()) { case STDOUT: case RAW: if (stdout != null) { stdout.write(frame.getPayload()); stdout.flush(); } break; case STDERR: if (stderr != null) { stderr.write(frame.getPayload()); stderr.flush(); } break; default: LOGGER.error("unknown stream type:" + frame.getStreamType()); } } catch (IOException e) { onError(e); } LOGGER.debug(frame.toString()); } }