Package org.apache.hadoop.hbase.util

Examples of org.apache.hadoop.hbase.util.Base64$Base64OutputStream


       
        try {
            byte[] data = plaintext.getBytes("UTF-8"); //$NON-NLS-1$
            byte[] cyphertext = encrypt(key, data);
            ByteArrayOutputStream barrout = new ByteArrayOutputStream(cyphertext.length*3/2);
            Base64OutputStream base64 = new Base64OutputStream(barrout);
            base64.write(cyphertext);
            base64.flush();
            barrout.flush();
            //Base64 is ASCII safe
            String ret = barrout.toString("ASCII"); //$NON-NLS-1$
            return ret;
        } catch(IOException e) {
View Full Code Here


    if (o instanceof Node)
      return serialize((Node) o);
    if (o instanceof Header[])
      return serialize((Header[]) o);
    ByteArrayOutputStream w = new ByteArrayOutputStream();
    Base64OutputStream base64OutputStream = new Base64OutputStream(w);
    ObjectOutputStream os = new ObjectOutputStream(base64OutputStream);
    os.writeObject(o);
    os.flush();
    os.close();
    base64OutputStream.flush();
    base64OutputStream.close();
    return w.toString("UTF-8");
  }
View Full Code Here

    private void openConnection() throws IOException {
        this.socket = new Socket(mailServer, MuConfigurations.getPreferences().getVariable(MuPreference.SMTP_PORT, MuPreferences.DEFAULT_SMTP_PORT));
        this.in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"));
        this.out = socket.getOutputStream();
        this.out64 = new Base64OutputStream(out, true);
   
        this.connectedToMailServer = true;
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.util.Base64$Base64OutputStream

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.