Package org.togglz.core.util
Class IOUtils
java.lang.Object
org.togglz.core.util.IOUtils
Provides utility methods for working with I/O streams.
Based on com.google.common.io.* from com.google.guava:17.0
- Author:
- Chris Nokleberg, Colin Decker, Bin Zhu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(InputStream s) static longcopy(InputStream from, OutputStream to) Copies all bytes from the input stream to the output stream.static longcopy(Readable from, Appendable to) Copies all characters between theReadableandAppendableobjects.static String
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
close
-
copy
Copies all bytes from the input stream to the output stream. Does not close or flush either stream.- Parameters:
from- the input stream to read fromto- the output stream to write to- Returns:
- the number of bytes copied
- Throws:
IOException- if an I/O error occurs
-
toString
- Parameters:
r- the object to read from- Returns:
- a string containing all the characters
- Throws:
IOException- if an I/O error occurs
-
copy
Copies all characters between theReadableandAppendableobjects. Does not close or flush either object.- Parameters:
from- the object to read fromto- the object to write to- Returns:
- the number of characters copied
- Throws:
IOException- if an I/O error occurs
-