Class Reads

java.lang.Object
com.oracle.coherence.common.base.Reads

public abstract class Reads extends Object
Class for providing read functionality.
Since:
20.06
Author:
cp 2000.08.02
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    read(DataInput 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 passed stream and return the result as a byte array.
    static byte[]
    read(File file)
    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(Reader reader)
    Read the contents out of the passed Reader and return the result as a String.
    static byte[]
    read(URL url)
    Read the contents of the specified URL and return the result as a byte array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Reads

      public Reads()
  • Method Details

    • read

      public static int read(InputStream stream, byte[] ab) throws IOException
      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 from
      ab - 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

      public static byte[] read(InputStream stream) throws IOException
      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

      public static byte[] read(DataInput stream) throws IOException
      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

      public static byte[] read(DataInputStream stream) throws IOException
      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

      public static String read(Reader reader) throws IOException
      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

      public static byte[] read(File file) throws IOException
      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

      public static byte[] read(URL url) throws IOException
      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