All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.gesellix.docker.response.LineReader Maven / Gradle / Ivy

There is a newer version: 2024-11-28T22-05-00
Show newest version
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