Quadcap Embeddable Database

com.quadcap.io.IO Class Reference

List of all members.

Detailed Description

Author:
Stan Bailes

Definition at line 58 of file IO.java.

Static Public Member Functions

boolean cmpFile (File a, File b) throws IOException
 Diff two files, return true if the file contents are the same.

final void copyFile (File from, File to) throws IOException
 Copy a file.

final void copyStream (InputStream is, OutputStream os) throws IOException
 Copy 'is' to 'os' until EOF.

final void copyStream (InputStream is, OutputStream os, int bps, int buffered) throws IOException
 Rate limited stream copy.

final void copyStream (Reader r, Writer w) throws IOException
 Copy 'r' to 'w' until EOF.

final void copyStream (InputStream is, OutputStream os, int limit) throws IOException
 Copy 'is' to 'os' until EOF, or limit bytes are copied.

void write (OutputStream os, String s) throws IOException
 Write a string to an outputstream using the brutal low-byte extraction encoding technique.

void readFully (InputStream is, byte[] buf) throws IOException
 Read an inputstream into a byte buffer.

void deleteDirectory (File f) throws IOException
 Recursively delete an entire directory.


Member Function Documentation

boolean com.quadcap.io.IO.cmpFile File  a,
File  b
throws IOException [static]
 

Diff two files, return true if the file contents are the same.

Definition at line 62 of file IO.java.

References com.quadcap.io.IO.cmpFile().

Referenced by com.quadcap.io.IO.cmpFile().

final void com.quadcap.io.IO.copyFile File  from,
File  to
throws IOException [static]
 

Copy a file.

Definition at line 87 of file IO.java.

References com.quadcap.io.IO.copyFile(), and com.quadcap.io.IO.copyStream().

Referenced by com.quadcap.io.IO.copyFile().

final void com.quadcap.io.IO.copyStream InputStream  is,
OutputStream  os,
int  limit
throws IOException [static]
 

Copy 'is' to 'os' until EOF, or limit bytes are copied.

Definition at line 160 of file IO.java.

final void com.quadcap.io.IO.copyStream Reader  r,
Writer  w
throws IOException [static]
 

Copy 'r' to 'w' until EOF.

Definition at line 147 of file IO.java.

final void com.quadcap.io.IO.copyStream InputStream  is,
OutputStream  os,
int  bps,
int  buffered
throws IOException [static]
 

Rate limited stream copy.

Copy the input stream to the output until EOF. An initial series of "buffered" bytes is sent with no rate limit, thereafter, bytes are streamed (in 4Kbyte buffers) at the rate limit "bps" bytes per/sec. No particular effort is made to buffer the incoming stream.

Definition at line 121 of file IO.java.

final void com.quadcap.io.IO.copyStream InputStream  is,
OutputStream  os
throws IOException [static]
 

Copy 'is' to 'os' until EOF.

Definition at line 104 of file IO.java.

References com.quadcap.io.IO.copyStream().

Referenced by com.quadcap.io.IO.copyFile(), and com.quadcap.io.IO.copyStream().

void com.quadcap.io.IO.deleteDirectory File  f  )  throws IOException [static]
 

Recursively delete an entire directory.

Be careful!

Definition at line 207 of file IO.java.

References com.quadcap.io.IO.deleteDirectory().

Referenced by com.quadcap.io.IO.deleteDirectory().

void com.quadcap.io.IO.readFully InputStream  is,
byte[]  buf
throws IOException [static]
 

Read an inputstream into a byte buffer.

Definition at line 191 of file IO.java.

References com.quadcap.io.IO.readFully().

Referenced by com.quadcap.io.IO.readFully().

void com.quadcap.io.IO.write OutputStream  os,
String  s
throws IOException [static]
 

Write a string to an outputstream using the brutal low-byte extraction encoding technique.

Works great for ISO-8859-1.

Definition at line 183 of file IO.java.

References com.quadcap.io.IO.write().

Referenced by com.quadcap.io.IO.write().