Class ReadBytes

java.lang.Object
com.reallifedeveloper.tools.ReadBytes

public final class ReadBytes extends Object
Utility class to read a file and display the content as bytes.
Author:
RealLifeDeveloper
  • Method Details

    • main

      public static void main(String... args) throws IOException, URISyntaxException
      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 failed
      URISyntaxException - if the provided URL is malformed
    • logBytesFromUrl

      public static void logBytesFromUrl(URL url) throws IOException
      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 from url failed