Package io.hawt.util
Class IOHelper
java.lang.Object
io.hawt.util.IOHelper
A collection of IO helpers
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses the given resource if it is available, logging any closing exceptions to the given log.static voidcopy(InputStream is, OutputStream os) static intstatic intstatic StringreadFully(BufferedReader reader) Reads the entire reader into memory as a Stringstatic Stringstatic voidstatic voidWrites the given data to the file; either in append mode or replace mode depending on the append flag.static voidWrites the text to the given file, overwriting the previous file if it existed.static voidWrites the given text to the file; either in append mode or replace mode depending on the append flag.
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
-
Constructor Details
-
IOHelper
public IOHelper()
-
-
Method Details
-
readFully
- Throws:
IOException
-
readFully
Reads the entire reader into memory as a String- Throws:
IOException
-
close
Closes the given resource if it is available, logging any closing exceptions to the given log.- Parameters:
closeable- the object to closename- the name of the resourcelog- the log to use when reporting closure warnings, will use this class's ownLoggerif log == null
-
write
Writes the text to the given file, overwriting the previous file if it existed.- Throws:
IOException
-
write
- Throws:
IOException
-
write
Writes the given text to the file; either in append mode or replace mode depending on the append flag.- Throws:
IOException
-
write
Writes the given data to the file; either in append mode or replace mode depending on the append flag.- Throws:
IOException
-
copy
- Throws:
IOException
-
copy
- Throws:
IOException
-
copy
- Throws:
IOException
-