Commit f71e01fc authored by Greg Messner's avatar Greg Messner
Browse files

Initial check-in.

parent d7af9c37
package com.messners.gitlab.api;
import java.io.IOException;
import java.io.Reader;
public class Utils {
/**
* Reads the content of a Reader instance and returns it as a String.
*
* @param reader
* @return the content of a Reader instance as a String
* @throws IOException
*/
public static String getReaderContentAsString (Reader reader) throws IOException {
int count;
final char[] buffer = new char[2048];
final StringBuilder out = new StringBuilder();
while ((count = reader.read(buffer, 0, buffer.length)) >= 0) {
out.append(buffer, 0, count);
}
return (out.toString());
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment