de.gesellix.docker.response.LineReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docker-engine Show documentation
Show all versions of docker-engine Show documentation
Bare HTTP client for the Docker engine api
package de.gesellix.docker.response;
import okio.BufferedSource;
import okio.Okio;
import okio.Source;
import java.io.IOException;
public class LineReader implements Reader {
private final BufferedSource buffer;
public LineReader(Source source) {
this.buffer = Okio.buffer(source);
}
@Override
public String readNext(Class type) throws IOException {
return buffer.readUtf8Line();
}
@Override
public boolean hasNext() throws IOException {
return !Thread.currentThread().isInterrupted() && !buffer.exhausted();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy