Skip navigation links

Oracle© Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.3)
E10684-11


oracle.adf.view.rich.util
Class StreamUtils

java.lang.Object
  extended by oracle.adf.view.rich.util.StreamUtils


public class StreamUtils
extends java.lang.Object

Utility method for working with various types of streams.


Method Summary
static void copy(java.io.InputStream is, java.io.OutputStream os)
          Copies the InputStream to the OutputStream using a 4k buffer.
static void copy(java.io.InputStream is, java.io.OutputStream os, int size)
          Copies the InputStream to the OutputStream using a defined buffer size in bytes.
static void copy(java.io.Reader in, java.io.Writer out)
          Copies a Reader to a Writer with an 4096 char buffer.
static void copy(java.io.Reader in, java.io.Writer out, int size)
          Copies a Reader to a Writer with a buffer of size characters.
static int fill(byte[] buffer, java.io.InputStream is)
          Reads data from the InputStream and tries to fill the buffer.
static java.io.InputStream getPartitionedInputStream(java.io.InputStream is, int len)
          Returns an InputStream that is a partition of another InputStream.
static java.lang.String toString(java.io.InputStream is, java.lang.String encoding)
          Returns a string representation of this input stream.

 

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

 

Method Detail

copy

public static void copy(java.io.InputStream is,
                        java.io.OutputStream os)
                 throws java.io.IOException
Copies the InputStream to the OutputStream using a 4k buffer.
Parameters:
is -
os -
Throws:
java.io.IOException

copy

public static void copy(java.io.InputStream is,
                        java.io.OutputStream os,
                        int size)
                 throws java.io.IOException
Copies the InputStream to the OutputStream using a defined buffer size in bytes.
Parameters:
is -
os -
size -
Throws:
java.io.IOException

copy

public static void copy(java.io.Reader in,
                        java.io.Writer out)
                 throws java.io.IOException
Copies a Reader to a Writer with an 4096 char buffer.
Parameters:
in -
out -
Throws:
java.io.IOException

copy

public static void copy(java.io.Reader in,
                        java.io.Writer out,
                        int size)
                 throws java.io.IOException
Copies a Reader to a Writer with a buffer of size characters.
Parameters:
in -
out -
size -
Throws:
java.io.IOException

fill

public static int fill(byte[] buffer,
                       java.io.InputStream is)
                throws java.io.IOException
Reads data from the InputStream and tries to fill the buffer. This may take several reads from the stream depending on the underlying stream implementation. In general the buffer will be filled unless the end of the stream is encountered.
Parameters:
buffer -
is -
Returns:
Throws:
java.io.IOException

getPartitionedInputStream

public static java.io.InputStream getPartitionedInputStream(java.io.InputStream is,
                                                            int len)
Returns an InputStream that is a partition of another InputStream. This partition must have a specified size. It is assumed that this substream will be read and closed before a new substream is started or before the original stream is read from again.
Parameters:
is -
len -
Returns:

toString

public static java.lang.String toString(java.io.InputStream is,
                                        java.lang.String encoding)
Returns a string representation of this input stream.
Parameters:
is -
Returns:

Skip navigation links

Oracle© Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.3)
E10684-11


Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.