# com.bea.ide.util
IOUtil Class

public class IOUtil
extends `Object`

A collection of methods that help with some basic IO. Generally, use of the FileSvc is encouraged but for some uses, these methods will be helpful.

Related Topics

``FileSvc``

Hierarchy
  `Object`
  `IOUtil`

## Constructor Summary

IOUtil()

## Method Summary

`public static `String`` | `read`(`Reader` in) Method to read data into a string from a reader.
`public static `String`` | `read`(`URI` uri) Helper method to read data from a file described by URI and return a string
`public static `URI`` | `saveToTempFile`(`String` source, `String` extension) Helper method that uses the FileSvc to save to a temp file

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

## Constructor Detail

### IOUtil

    public IOUtil()

## Method Detail

### read(Reader) Method

    public static String read(Reader in)

Method to read data into a string from a reader.

#### Parameters

in
  reader to use for reading data

#### Returns

string created from reading input

### read(URI) Method

    public static String read(URI uri)

Helper method to read data from a file described by URI and return a string

#### Parameters

uri
  URI describing the file

#### Returns

string representing the contents of the file

### saveToTempFile(String, String) Method

    public static URI saveToTempFile(String source,
                                     String extension)

Helper method that uses the FileSvc to save to a temp file

#### Parameters

source
  string data to save to the temp file

extension
  extension to use for the temp file

#### Returns

URI describing the new temporary file, or null if there was a failure saving the file