Package com.reallifedeveloper.tools
Class ReadBytes
java.lang.Object
com.reallifedeveloper.tools.ReadBytes
Utility class to read a file and display the content as bytes.
- Author:
- RealLifeDeveloper
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
logBytesFromUrl
(URL url) Reads bytes from the given URL and logs them at info level, both as hexadecimal byte values and as an ASCII string.static void
Main method to read bytes from a URL and log the result.
-
Method Details
-
main
Main method to read bytes from a URL and log the result.- Parameters:
args
- a string array that should contain one element, the URL to read from- Throws:
IOException
- if reading from the URL failedURISyntaxException
- if the provided URL is malformed
-
logBytesFromUrl
Reads bytes from the given URL and logs them at info level, both as hexadecimal byte values and as an ASCII string.- Parameters:
url
- the URL to read from- Throws:
IOException
- if reading fromurl
failed
-