Class StreamUtils

java.lang.Object
org.zalando.fahrschein.http.api.StreamUtils

public class StreamUtils extends Object
  • Field Details

    • BUFFER_SIZE

      public static final int BUFFER_SIZE
      The default buffer size used when copying bytes.
      See Also:
  • Constructor Details

    • StreamUtils

      public StreamUtils()
  • Method Details

    • drain

      public static int drain(InputStream in) throws IOException
      Drain the remaining content of the given InputStream.

      Leaves the InputStream open when done.

      Parameters:
      in - the InputStream to drain
      Returns:
      the number of bytes read
      Throws:
      IOException - in case of I/O errors