Package com.caucho.db.blob

Examples of com.caucho.db.blob.BlobOutputStream


      return;
    }

    setNonNull(block, rowOffset);

    BlobOutputStream os = null;
   
    try {
      os = new BlobOutputStream(xa, getTable(),
                                block, rowOffset + _columnOffset);

      int length = str.length();
      for (int i = 0; i < length; i++) {
        int ch = str.charAt(i);

        if (ch < 0x80)
          os.write(ch);
        else if (ch < 0x800) {
          os.write(0xc0 + (ch >> 6));
          os.write(0x80 + (ch & 0x3f));
        }
        else {
          os.write(0xe0 + (ch >> 12));
          os.write(0x80 + ((ch >> 6) & 0x3f));
          os.write(0x80 + (ch & 0x3f));
        }
      }
    } catch (IOException e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
View Full Code Here


    }

    setNonNull(block, rowOffset);

    try {
      BlobOutputStream os;
      os = new BlobOutputStream(xa, getTable(),
                                block, rowOffset + _columnOffset);

      os.writeFromStream(value);

      os.close();
      value.close();
    } catch (IOException e) {
      log.log(Level.WARNING, e.toString(), e);
    }
  }
View Full Code Here

      return;
    }

    setNonNull(block, rowOffset);

    BlobOutputStream os = null;
   
    try {
      os = new BlobOutputStream(xa, getTable(),
        block, rowOffset + _columnOffset);

      int length = str.length();
      for (int i = 0; i < length; i++) {
  int ch = str.charAt(i);

  if (ch < 0x80)
    os.write(ch);
  else if (ch < 0x800) {
    os.write(0xc0 + (ch >> 6));
    os.write(0x80 + (ch & 0x3f));
  }
  else {
    os.write(0xe0 + (ch >> 12));
    os.write(0x80 + ((ch >> 6) & 0x3f));
    os.write(0x80 + (ch & 0x3f));
  }
      }
    } catch (IOException e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
View Full Code Here

    }

    setNonNull(block, rowOffset);

    try {
      BlobOutputStream os;
      os = new BlobOutputStream(xa, getTable(),
        block, rowOffset + _columnOffset);

      os.writeFromStream(value);

      os.close();
      value.close();
    } catch (IOException e) {
      log.log(Level.WARNING, e.toString(), e);
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.db.blob.BlobOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.