Oracle

com.compoze.util
Class ReaderInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.compoze.util.ReaderInputStream
All Implemented Interfaces:
java.io.Closeable

public class ReaderInputStream
extends java.io.InputStream

This class wraps an input stream with a reader. Warning: All characters have their high order bytes stripped off.


Constructor Summary
ReaderInputStream(java.io.Reader reader)
          Constructor.
 
Method Summary
 int read()
          Read the next byte of data from the input stream.
 int read(byte[] array)
          Read an array of bytes from the input stream.
 int read(byte[] array, int iOffset, int iLength)
          Read an array of bytes from the input stream.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, 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(java.io.Reader reader)
Constructor.

Parameters:
reader - the underlying reader
Method Detail

read

public int read()
         throws java.io.IOException
Read the next byte of data from the input stream.

Specified by:
read in class java.io.InputStream
Returns:
the next byte
Throws:
java.io.IOException - if an i/o error occurred

read

public int read(byte[] array)
         throws java.io.IOException
Read an array of bytes from the input stream.

Overrides:
read in class java.io.InputStream
Parameters:
array - the array to read into
Returns:
the number of bytes read
Throws:
java.io.IOException

read

public int read(byte[] array,
                int iOffset,
                int iLength)
         throws java.io.IOException
Read an array of bytes from the input stream.

Overrides:
read in class java.io.InputStream
Parameters:
array - the array to read into
iOffset - the offset in the array to read to
iLength - the number of bytes to read
Returns:
the number of bytes read
Throws:
java.io.IOException

Oracle

Copyright ©1999-2008 Oracle All rights reserved.