Class IOUtils

java.lang.Object
org.firebirdsql.jaybird.util.IOUtils

public final class IOUtils extends Object
Utility methods for stream and byte array conversions.
Since:
3.0
Author:
Mark Rotteveel
  • Method Details

    • toBytes

      public static byte[] toBytes(InputStream in, int length) throws IOException
      Reads length bytes from in to a byte array, or until EOF.
      Parameters:
      in - input stream
      length - number of bytes to read (or -1 to read until EOF)
      Returns:
      byte array; length is the actual number of bytes read when EOF was reached before length
      Throws:
      IOException - for exceptions reading from in
    • toString

      public static String toString(Reader in, int length) throws IOException
      Reads length characters from in to a string, or until EOF.
      Parameters:
      in - input stream
      length - number of characters to read (or -1 to read until EOF)
      Returns:
      string; length is the actual number of characters read when EOF was reached before length
      Throws:
      IOException - for exceptions reading from in