Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
f71e01fc
Commit
f71e01fc
authored
Mar 02, 2014
by
Greg Messner
Browse files
Initial check-in.
parent
d7af9c37
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/com/messners/gitlab/api/Utils.java
0 → 100644
View file @
f71e01fc
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment