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) Readslengthbytes frominto a byte array, or until EOF.static StringReadslengthcharacters frominto a string, or until EOF.
-
Method Details
-
toBytes
Readslengthbytes frominto a byte array, or until EOF.- Parameters:
in- input streamlength- number of bytes to read (or-1to 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
Readslengthcharacters frominto a string, or until EOF.- Parameters:
in- input streamlength- number of characters to read (or-1to 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
-