Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.util 6.8.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.util.io
Class ReaderInputStream

    java.lang.Object
      java.io.InputStream
          org.openide.util.io.ReaderInputStream

All Implemented Interfaces:
  Closeable

    public class ReaderInputStream

extends InputStream

This class convert Reader to InputStream. It works by converting the characters to the encoding specified in constructor parameter.

Constructor Summary
`ReaderInputStream(Reader reader)` Creates new input stream from the given reader.
`ReaderInputStream(Reader reader, String encoding)` Creates new input stream from the given reader and encoding.

Method Summary
`int` | `available()`
`void` | `close()`
`int` | `read()`
`int` | `read(byte[] b, int off, int len)`

Methods inherited from class java.io.InputStream
`mark, markSupported, read, reset, skip`

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

Constructor Detail

### ReaderInputStream

    public ReaderInputStream(Reader reader)
                      throws IOException

  Creates new input stream from the given reader. Uses the platform default encoding.

  Parameters:
    `reader` - Input reader
  Throws:
    `IOException`

### ReaderInputStream

    public ReaderInputStream(Reader reader,
                             String encoding)
                      throws IOException

  Creates new input stream from the given reader and encoding.

  Parameters:
    `reader` - Input reader
    `encoding` -
  Throws:
    `IOException`

Method Detail

### read

    public int read()
             throws IOException

  Specified by:
    `read` in class `InputStream`
  Throws:
    `IOException`

### read

    public int read(byte[] b,
                    int off,
                    int len)
             throws IOException

  Overrides:
    `read` in class `InputStream`
  Throws:
    `IOException`

### available

    public int available()
                  throws IOException

  Overrides:
    `available` in class `InputStream`
  Throws:
    `IOException`

### close

    public void close()
               throws IOException

  Specified by:
    `close` in interface `Closeable`
  Overrides:
    `close` in class `InputStream`
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.util 6.8.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.