Logo Search packages:      
Sourcecode: jlha-utils version File versions  Download package

int org::jlhafrontend::JLHAFrontEnd::transferTo ( InputStream  in,
OutputStream  out 
) [inline]

Transfer an InputStream to an OutputStream

Parameters:
in the input stream
out the output stream
Returns:
number of blocks (8k bytes) copied

Definition at line 170 of file JLHAFrontEnd.java.

References mylogger.

Referenced by createFile(), and transferBackupToArchive().

                                                            {
      int i,bufRead;
      byte[] buf = new byte[1024*8];
      for (i=0; true; i++) {
          try {
            bufRead=in.read(buf);
          } catch (Exception e) {
            mylogger.severe("read from in "+e.toString());
            break;
          }
          if (bufRead<=0) break;
          try {
            out.write(buf,0,bufRead);
          } catch (Exception e) {
            mylogger.severe("write to out "+e.toString());
            break;
          }
      }
      return i;
    }


Generated by  Doxygen 1.6.0   Back to index