private void writeInternal(byte[] b,int off,int len) throws IOException {
  try {
    if (off == 0 && len == b.length && len <= owner.getBufferLength()) {
      writeSegment(b);
    }
 else {
      int chunk=Math.min(owner.getBufferLength(),len);
      byte[] buffer=new byte[chunk];
      while (len > 0) {
        chunk=Math.min(len,chunk);
        if (chunk != buffer.length) {
          buffer=new byte[chunk];
        }
        System.arraycopy(b,off,buffer,0,chunk);
        writeSegment(buffer);
        len-=chunk;
        off+=chunk;
      }
    }
  }
 catch (  SQLException ge) {
    throw new IOException("Problem writing to FBBlobOutputStream: " + ge.getMessage(),ge);
  }
}

private void writeInternal ( byte [ ] b , int off , int len ) throws IOException { try { if ( off == 0 && len == b . length && len <= owner . getBufferLength ( ) ) { writeSegment ( b ) ; } else { int chunk = Math . min ( owner . getBufferLength ( ) , len ) ; byte [ ] buffer = new byte [ chunk ] ; while ( len > 0 ) { chunk = Math . min ( len , chunk ) ; if ( chunk != buffer . length ) { buffer = new byte [ chunk ] ; } System . arraycopy ( b , off , buffer , 0 , chunk ) ; writeSegment ( buffer ) ; len -= chunk ; off += chunk ; } } } catch ( SQLException ge ) { throw new IOException ( "Problem writing to FBBlobOutputStream: " + ge . getMessage ( ) , ge ) ; } }
performs unbuffered writes to the blob .
