Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.ide.util
Class FileUtilities

java.lang.Object
  extended by oracle.ide.util.FileUtilities


public final class FileUtilities
extends java.lang.Object

The FileUtilities contain utility routine for I/O operations.


Constructor Summary
FileUtilities()
           

 

Method Summary
static byte[] readFile(java.net.URL url)
          Reads the contents of the URL completely into memory, returning the contents as a byte array.
static void writeFile(java.net.URL url, byte[] data)
          Writes the specified contents to the URL location.
static void writeFile(java.net.URL url, byte[] data, int offset, int count)
          Writes the specified contents to the URL location.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

FileUtilities

public FileUtilities()

Method Detail

readFile

public static byte[] readFile(java.net.URL url)
                       throws java.io.IOException
Reads the contents of the URL completely into memory, returning the contents as a byte array. If the url does not exist, or an I/O error occurs while reading it, an IOException may be thrown.
Parameters:
url - the url to read in
Throws:
java.io.IOException - if the url cannot be read

writeFile

public static void writeFile(java.net.URL url,
                             byte[] data)
                      throws java.io.IOException
Writes the specified contents to the URL location. If the an error occurs while writing to the URL (i.e., disk is full, or url is read-protected), an IOException will be thrown. In the case of an IOException, the contents of the URL will be unpredictable
Parameters:
url - the url to write to
count - the number of bytes from the array to write out
Throws:
java.io.IOException - if the url cannot be written to

writeFile

public static void writeFile(java.net.URL url,
                             byte[] data,
                             int offset,
                             int count)
                      throws java.io.IOException
Writes the specified contents to the URL location. If the an error occurs while writing to the URL (i.e., disk is full, or url is read-protected), an IOException will be thrown. In the case of an IOException, the contents of the URL will be unpredictable
Parameters:
url - the url to write to
data - the data to write out
offset - the offset in the array where the byte data starts
count - the number of bytes from the array to write out
Throws:
java.io.IOException - if the url cannot be written to

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.