java.lang.Object
org.firebirdsql.jaybird.util.IOUtils
Utility methods for stream and byte array conversions.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
toBytes
(InputStream in, int length) Readslength
bytes fromin
to a byte array, or until EOF.static String
Readslength
characters fromin
to a string, or until EOF.
-
Method Details
-
toBytes
Readslength
bytes fromin
to a byte array, or until EOF.- Parameters:
in
- input streamlength
- 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 fromin
-
toString
Readslength
characters fromin
to a string, or until EOF.- Parameters:
in
- input streamlength
- 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 fromin
-