Package com.oracle.coherence.common.base
Class Reads
java.lang.Object
com.oracle.coherence.common.base.Reads
Class for providing read functionality.
- Since:
- 20.06
- Author:
- cp 2000.08.02
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Read the contents out of the passed stream and return the result as a byte array.static byte[]
read
(DataInputStream stream) Read the contents out of the passed stream and return the result as a byte array.static byte[]
Read the contents out of the specified file and return the result as a byte array.static byte[]
read
(InputStream stream) Read the contents out of the passed stream and return the result as a byte array.static int
read
(InputStream stream, byte[] ab) Read the contents out of the passed stream into the passed byte array and return the length read.static String
Read the contents out of the passed Reader and return the result as a String.static byte[]
Read the contents of the specified URL and return the result as a byte array.
-
Constructor Details
-
Reads
public Reads()
-
-
Method Details
-
read
Read the contents out of the passed stream into the passed byte array and return the length read. This method will read up to the number of bytes that can fit into the passed array.- Parameters:
stream
- a java.io.InputStream object to read fromab
- a byte array to read into- Returns:
- the number of bytes read from the InputStream and stored into the passed byte array
- Throws:
IOException
- if an error occurs
-
read
Read the contents out of the passed stream and return the result as a byte array.- Parameters:
stream
- a java.io.InputStream object to read from- Returns:
- a byte array containing the contents of the passed InputStream
- Throws:
IOException
- if an error occurs
-
read
Read the contents out of the passed stream and return the result as a byte array.- Parameters:
stream
- a java.io.DataInput object to read from- Returns:
- a byte array containing the contents of the passed stream
- Throws:
IOException
- if an error occurs
-
read
Read the contents out of the passed stream and return the result as a byte array.- Parameters:
stream
- a java.io.DataInputStream object to read from- Returns:
- a byte array containing the contents of the passed InputStream
- Throws:
IOException
- if an error occurs
-
read
Read the contents out of the passed Reader and return the result as a String.- Parameters:
reader
- a java.io.Reader object to read from- Returns:
- a String containing the contents of the passed Reader
- Throws:
IOException
- if an error occurs
-
read
Read the contents out of the specified file and return the result as a byte array.- Parameters:
file
- the java.io.File object to read the contents of- Returns:
- the contents of the specified File as a byte array
- Throws:
IOException
- if an error occurs
-
read
Read the contents of the specified URL and return the result as a byte array.- Parameters:
url
- the java.net.URL object to read the contents of- Returns:
- the contents of the specified URL as a byte array
- Throws:
IOException
- if an error occurs
-