content: package com.am1goo.bloodseeker.utilities;
  
  import java.io.ByteArrayOutputStream;
  import java.io.File;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  
  public class IOUtilities {
  
      public static String getTempDir() {
          return System.getProperty("java.io.tmpdir");
      }
  
      public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException {
          byte[] buffer = new byte[1024];
          int len;
          while ((len = inputStream.read(buffer)) != -1) {
              outputStream.write(buffer, 0, len);
          }
      }
  
      public static byte[] readAllBytes(InputStream inputStream) throws IOException {
          ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
          byte[] buffer = new byte[8 * 1024];
          int bytesRead;
          while ((bytesRead = inputStream.read(buffer)) != -1) {
              outputStream.write(buffer, 0, bytesRead);
          }
          outputStream.flush();
          return outputStream.toByteArray();
      }
  
      public static String readAllText(InputStream inputStream) {
          try {
              int bufferSize = 1024;
              char[] buffer = new char[bufferSize];
              StringBuilder out = new StringBuilder();
              java.io.Reader in = new java.io.InputStreamReader(inputStream);
              for (int numRead; (numRead = in.read(buffer, 0, buffer.length)) > 0; ) {
                  out.append(buffer, 0, numRead);
              }
              return out.toString();
          }
          catch (Exception ex) {
              return "";
          }
      }
  }
  