亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? base64encoderstream.java

?? java Email you can use it to send email to others
?? JAVA
字號:
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License").  You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code.  If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license."  If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above.  However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. *//* * @(#)BASE64EncoderStream.java	1.10 07/05/04 */package com.sun.mail.util;import java.io.*;/** * This class implements a BASE64 encoder.  It is implemented as * a FilterOutputStream, so one can just wrap this class around * any output stream and write bytes into this filter.  The encoding * is done as the bytes are written out. *  * @author John Mani * @author Bill Shannon */public class BASE64EncoderStream extends FilterOutputStream {    private byte[] buffer; 	// cache of bytes that are yet to be encoded    private int bufsize = 0;	// size of the cache    private byte[] outbuf; 	// line size output buffer    private int count = 0; 	// number of bytes that have been output    private int bytesPerLine;	// number of bytes per line    private int lineLimit;	// number of input bytes to output bytesPerLine    private boolean noCRLF = false;    private static byte[] newline = new byte[] { '\r', '\n' };    /**     * Create a BASE64 encoder that encodes the specified output stream.     *     * @param out        the output stream     * @param bytesPerLine  number of bytes per line. The encoder inserts     * 			a CRLF sequence after the specified number of bytes,     *			unless bytesPerLine is Integer.MAX_VALUE, in which     *			case no CRLF is inserted.  bytesPerLine is rounded     *			down to a multiple of 4.     */    public BASE64EncoderStream(OutputStream out, int bytesPerLine) {	super(out);	buffer = new byte[3];	if (bytesPerLine == Integer.MAX_VALUE || bytesPerLine < 4) {	    noCRLF = true;	    bytesPerLine = 76;	}	bytesPerLine = (bytesPerLine / 4) * 4;	// Rounded down to 4n	this.bytesPerLine = bytesPerLine;	// save it        lineLimit = bytesPerLine / 4 * 3;	if (noCRLF) {	    outbuf = new byte[bytesPerLine];	} else {	    outbuf = new byte[bytesPerLine + 2];	    outbuf[bytesPerLine] = (byte)'\r';	    outbuf[bytesPerLine + 1] = (byte)'\n';	}    }    /**     * Create a BASE64 encoder that encodes the specified input stream.     * Inserts the CRLF sequence after outputting 76 bytes.     *     * @param out        the output stream     */    public BASE64EncoderStream(OutputStream out) {	this(out, 76);	    }    /**     * Encodes <code>len</code> bytes from the specified     * <code>byte</code> array starting at offset <code>off</code> to     * this output stream.     *     * @param      b     the data.     * @param      off   the start offset in the data.     * @param      len   the number of bytes to write.     * @exception  IOException  if an I/O error occurs.     */    public synchronized void write(byte[] b, int off, int len)				throws IOException {	int end = off + len;	// finish off incomplete coding unit	while (bufsize != 0 && off < end)	    write(b[off++]);	// finish off line	int blen = ((bytesPerLine - count) / 4) * 3;	if (off + blen < end) {	    // number of bytes that will be produced in outbuf	    int outlen = encodedSize(blen);	    if (!noCRLF) {		outbuf[outlen++] = (byte)'\r';		outbuf[outlen++] = (byte)'\n';	    }	    out.write(encode(b, off, blen, outbuf), 0, outlen);	    off += blen;	    count = 0;	}	// do bulk encoding a line at a time.	for (; off + lineLimit < end; off += lineLimit)	    out.write(encode(b, off, lineLimit, outbuf));	// handle remaining partial line	if (off + 3 < end) {	    blen = end - off;	    blen = (blen / 3) * 3;	// round down	    // number of bytes that will be produced in outbuf	    int outlen = encodedSize(blen);	    out.write(encode(b, off, blen, outbuf), 0, outlen);	    off += blen;	    count += outlen;	}	// start next coding unit	for (; off < end; off++)	    write(b[off]);    }    /**     * Encodes <code>b.length</code> bytes to this output stream.     *     * @param      b   the data to be written.     * @exception  IOException  if an I/O error occurs.     */    public void write(byte[] b) throws IOException {	write(b, 0, b.length);    }    /**     * Encodes the specified <code>byte</code> to this output stream.     *     * @param      c   the <code>byte</code>.     * @exception  IOException  if an I/O error occurs.     */    public synchronized void write(int c) throws IOException {	buffer[bufsize++] = (byte)c;	if (bufsize == 3) { // Encoding unit = 3 bytes	    encode();	    bufsize = 0;	}    }    /**     * Flushes this output stream and forces any buffered output bytes     * to be encoded out to the stream.      *     * @exception  IOException  if an I/O error occurs.     */    public synchronized void flush() throws IOException {	if (bufsize > 0) { // If there's unencoded characters in the buffer ..	    encode();      // .. encode them	    bufsize = 0;	}	out.flush();    }    /**     * Forces any buffered output bytes to be encoded out to the stream     * and closes this output stream     */    public synchronized void close() throws IOException {	flush();	if (count > 0 && !noCRLF) {	    out.write(newline);	    out.flush();	}	out.close();    }    /** This array maps the characters to their 6 bit values */    private final static char pem_array[] = {	'A','B','C','D','E','F','G','H', // 0	'I','J','K','L','M','N','O','P', // 1	'Q','R','S','T','U','V','W','X', // 2	'Y','Z','a','b','c','d','e','f', // 3	'g','h','i','j','k','l','m','n', // 4	'o','p','q','r','s','t','u','v', // 5	'w','x','y','z','0','1','2','3', // 6	'4','5','6','7','8','9','+','/'  // 7    };    /**     * Encode the data stored in <code>buffer</code>.     * Uses <code>outbuf</code> to store the encoded     * data before writing.     *     * @exception  IOException  if an I/O error occurs.     */    private void encode() throws IOException {	int osize = encodedSize(bufsize);	out.write(encode(buffer, 0, bufsize, outbuf), 0, osize);	// increment count	count += osize;	// If writing out this encoded unit caused overflow,	// start a new line.	if (count >= bytesPerLine) {	    if (!noCRLF)		out.write(newline);	    count = 0;	}    }    /**     * Base64 encode a byte array.  No line breaks are inserted.     * This method is suitable for short strings, such as those     * in the IMAP AUTHENTICATE protocol, but not to encode the     * entire content of a MIME part.     */    public static byte[] encode(byte[] inbuf) {	if (inbuf.length == 0)	    return inbuf;	return encode(inbuf, 0, inbuf.length, null);    }    /**     * Internal use only version of encode.  Allow specifying which     * part of the input buffer to encode.  If outbuf is non-null,     * it's used as is.  Otherwise, a new output buffer is allocated.     */    private static byte[] encode(byte[] inbuf, int off, int size,				byte[] outbuf) {	if (outbuf == null)	    outbuf = new byte[encodedSize(size)];	int inpos, outpos;	int val;	for (inpos = off, outpos = 0; size >= 3; size -= 3, outpos += 4) {	    val = inbuf[inpos++] & 0xff;	    val <<= 8;	    val |= inbuf[inpos++] & 0xff;	    val <<= 8;	    val |= inbuf[inpos++] & 0xff;	    outbuf[outpos+3] = (byte)pem_array[val & 0x3f];	    val >>= 6;	    outbuf[outpos+2] = (byte)pem_array[val & 0x3f];	    val >>= 6;	    outbuf[outpos+1] = (byte)pem_array[val & 0x3f];	    val >>= 6;	    outbuf[outpos+0] = (byte)pem_array[val & 0x3f];	}	// done with groups of three, finish up any odd bytes left	if (size == 1) {	    val = inbuf[inpos++] & 0xff;	    val <<= 4;	    outbuf[outpos+3] = (byte)'=';	// pad character;	    outbuf[outpos+2] = (byte)'=';	// pad character;	    outbuf[outpos+1] = (byte)pem_array[val & 0x3f];	    val >>= 6;	    outbuf[outpos+0] = (byte)pem_array[val & 0x3f];	} else if (size == 2) {	    val = inbuf[inpos++] & 0xff;	    val <<= 8;	    val |= inbuf[inpos++] & 0xff;	    val <<= 2;	    outbuf[outpos+3] = (byte)'=';	// pad character;	    outbuf[outpos+2] = (byte)pem_array[val & 0x3f];	    val >>= 6;	    outbuf[outpos+1] = (byte)pem_array[val & 0x3f];	    val >>= 6;	    outbuf[outpos+0] = (byte)pem_array[val & 0x3f];	}	return outbuf;    }    /**     * Return the corresponding encoded size for the given number     * of bytes, not including any CRLF.     */    private static int encodedSize(int size) {	return ((size + 2) / 3) * 4;    }    /*** begin TEST program    public static void main(String argv[]) throws Exception {	FileInputStream infile = new FileInputStream(argv[0]);	BASE64EncoderStream encoder = new BASE64EncoderStream(System.out);	int c;	while ((c = infile.read()) != -1)	    encoder.write(c);	encoder.close();    }    *** end TEST program **/}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品一区二区三区在线观看| 麻豆免费精品视频| a级精品国产片在线观看| 日本一区二区免费在线观看视频 | 欧美一区二区三区喷汁尤物| 亚洲va韩国va欧美va精品| 欧美色倩网站大全免费| 亚洲图片自拍偷拍| 日韩一区二区三区在线| 蓝色福利精品导航| 国产日韩欧美精品一区| 99在线精品观看| 亚洲香肠在线观看| 日韩视频中午一区| 国产成人自拍在线| 一区二区三区四区在线| 欧美乱熟臀69xxxxxx| 秋霞国产午夜精品免费视频| 日韩久久久久久| a级精品国产片在线观看| 亚洲一二三区不卡| 日韩一区二区三区三四区视频在线观看| 免费在线观看一区| 亚洲欧美乱综合| 日韩精品一区二区三区四区| 成人免费视频一区| 香蕉久久夜色精品国产使用方法| 亚洲精品一区二区精华| 色综合天天综合狠狠| 日韩国产欧美视频| 国产精品久久久久久亚洲毛片| 91久久香蕉国产日韩欧美9色| 日韩高清国产一区在线| 中国色在线观看另类| 欧美日韩精品三区| 成人的网站免费观看| 日一区二区三区| 中文字幕乱码一区二区免费| 在线视频欧美精品| 国产一区二区女| 亚洲444eee在线观看| 国产精品人妖ts系列视频| 91精品国产综合久久久久久漫画| 成人av在线一区二区三区| 日韩一区欧美二区| 亚洲美女精品一区| 欧美激情中文字幕| 欧美电视剧免费观看| 欧美在线观看视频一区二区三区| 国产在线精品一区二区三区不卡| 亚洲一区二区三区自拍| 国产精品美女久久久久aⅴ| 日韩免费一区二区三区在线播放| 欧美性大战久久| 91亚洲国产成人精品一区二三| 美国av一区二区| 亚洲成a人v欧美综合天堂| 亚洲欧美成人一区二区三区| ww久久中文字幕| 欧美精品1区2区| 99精品偷自拍| 极品少妇一区二区三区精品视频| 亚洲免费av网站| 亚洲国产精品v| 日韩午夜电影在线观看| 欧美日韩国产综合久久| 一本到三区不卡视频| 激情伊人五月天久久综合| 亚洲高清免费视频| 久久综合视频网| 欧美日本乱大交xxxxx| 91网站在线播放| 国产99久久久久久免费看农村| 日本欧洲一区二区| 亚洲国产欧美一区二区三区丁香婷| 中文字幕一区二区视频| 亚洲精品在线观| 日韩一区二区三区在线观看 | 麻豆一区二区三| 一区二区视频在线| 久久久久久久久久久久久久久99| 欧美mv和日韩mv国产网站| 欧美手机在线视频| 色网站国产精品| 91免费看`日韩一区二区| 国产69精品久久久久毛片| 国内外成人在线| 国内精品写真在线观看| 麻豆91精品91久久久的内涵| 亚洲国产毛片aaaaa无费看| 亚洲国产视频在线| 亚洲午夜免费福利视频| 亚洲尤物在线视频观看| 亚洲欧美日韩国产中文在线| 国产精品国产自产拍高清av| 中文字幕不卡在线观看| 欧美国产乱子伦| 国产精品久久久久影院| 亚洲欧美激情视频在线观看一区二区三区| 国产清纯白嫩初高生在线观看91| 久久久久综合网| 国产精品天天看| 国产精品久久久久天堂| 亚洲精品第1页| 午夜激情久久久| 免费成人深夜小野草| 国产伦精品一区二区三区免费| bt欧美亚洲午夜电影天堂| 91亚洲国产成人精品一区二三 | 国产亚洲视频系列| 亚洲国产精品精华液ab| 日韩理论片网站| 亚洲小少妇裸体bbw| 日韩精品电影一区亚洲| 国产成人免费9x9x人网站视频| 成人午夜伦理影院| 欧美综合久久久| 日韩欧美中文一区二区| 久久久精品国产免大香伊| 综合分类小说区另类春色亚洲小说欧美| 亚洲视频一二三区| 亚洲二区在线视频| 国产一区二区三区免费看| av一区二区久久| 欧美这里有精品| 精品国产91乱码一区二区三区 | 国产精品免费av| 亚洲高清免费在线| 国产精品69毛片高清亚洲| 色婷婷综合五月| 欧美va亚洲va| 亚洲免费观看高清在线观看| 日韩不卡一区二区三区| av中文一区二区三区| 欧美乱妇15p| 中文字幕av在线一区二区三区| 中文字幕av免费专区久久| 日本一区二区三区国色天香| 青草国产精品久久久久久| 不卡免费追剧大全电视剧网站| 欧美日韩精品一区二区在线播放| 国产三级精品视频| 午夜电影久久久| 91蜜桃网址入口| 日韩欧美二区三区| 视频在线观看一区二区三区| 成人福利视频网站| 欧美不卡在线视频| 亚洲地区一二三色| av电影在线不卡| 精品福利在线导航| 一区二区三区欧美亚洲| 国产精品一区二区在线观看网站 | 欧美日韩精品电影| 国产精品高清亚洲| 久久国产日韩欧美精品| 欧美主播一区二区三区| 国产精品久久久久久户外露出 | 日韩二区三区四区| 久久 天天综合| 日韩丝袜情趣美女图片| 午夜不卡在线视频| 欧美伊人久久久久久久久影院 | 欧美第一区第二区| 亚洲国产精品欧美一二99| 97se亚洲国产综合在线| 久久精品综合网| 激情综合色综合久久| 日韩一级视频免费观看在线| 国产精品美女久久久久高潮| 国产最新精品免费| 日韩欧美国产一区在线观看| 一区二区三区成人| 在线亚洲高清视频| 亚洲乱码一区二区三区在线观看| 国产成人免费视频一区| 久久无码av三级| 国产一区在线观看视频| 欧美va亚洲va国产综合| 久久99精品久久久久久| 日韩欧美成人激情| 麻豆一区二区99久久久久| 国产亚洲一区字幕| 国产美女视频91| 国产欧美精品一区| 久久国产精品露脸对白| 欧美成人三级在线| 国内成人自拍视频| 久久久无码精品亚洲日韩按摩| 国产一区二区三区四区五区美女| 久久综合狠狠综合久久综合88| 日韩精品视频网站| 91麻豆精品国产91| 秋霞午夜av一区二区三区| 日韩免费看网站| 国产精品综合二区| 国产精品视频看| 色94色欧美sute亚洲线路一ni| 亚洲三级小视频| 欧美片网站yy|