• 大小: 19KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: Java
  • 标签: BASE64  

资源简介

sun.misc.BASE64Encoder 的源码及JAR包

资源截图

代码片段和文件信息

  /*
    2    * Copyright (c) 1995 2000 Oracle and/or its affiliates. All rights reserved.
    3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    4    *
    5    * This code is free software; you can redistribute it and/or modify it
    6    * under the terms of the GNU General Public License version 2 only as
    7    * published by the Free Software Foundation.  Oracle designates this
    8    * particular file as subject to the “Classpath“ exception as provided
    9    * by Oracle in the LICENSE file that accompanied this code.
   10    *
   11    * This code is distributed in the hope that it will be useful but WITHOUT
   12    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   14    * version 2 for more details (a copy is included in the LICENSE file that
   15    * accompanied this code).
   16    *
   17    * You should have received a copy of the GNU General Public License version
   18    * 2 along with this work; if not write to the Free Software Foundation
   19    * Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA.
   20    *
   21    * Please contact Oracle 500 Oracle Parkway Redwood Shores CA 94065 USA
   22    * or visit www.oracle.com if you need additional information or have any
   23    * questions.
   24    */
package sun.misc;

 import java.io.OutputStream;
import java.io.PushbackInputStream;
 import java.io.PrintStream;

 /**
   32    * This class implements a base64 Character decoder as specified in RFC1521.
   33    *
   34    * This RFC is part of the MIME specification which is published by the
   35    * Internet Engineering Task Force (IETF). Unlike some other encoding
   36    * schemes there is nothing in this encoding that tells the decoder
   37    * where a buffer starts or stops so to use it you will need to isolate
   38    * your encoded data into a single chunk and then feed them this decoder.
   39    * The simplest way to do that is to read all of the encoded data into a
   40    * string and then use:
   41    * 

   42    *      byte    mydata[];
   43    *      base64Decoder base64 = new base64Decoder();
   44    *
   45    *      mydata = base64.decodeBuffer(bufferString);
   46    * 

   47    * This will decode the String in bufferString and give you an array
   48    * of bytes in the array myData.
   49    *
   50    * On errors this class throws a CEFormatException with the following detail
   51    * strings:
   52    * 

   53    *    “base64Decoder: Not enough bytes for an atom.“
   54    * 

   55    *
   56    * @author      Chuck McManis
   57    * @see         CharacterEncoder
   58    * @see         base64Decoder
   59    */
 
  public class base64Decoder extends CharacterDecoder {
 
/** This class has 4 bytes per atom */
 protected int bytesPerAtom(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        7736  2015-02-09 10:55  base64Encoder.jar
     目录           0  2015-02-09 10:57  sun\
     目录           0  2015-02-09 10:57  sun\misc\
     文件        6094  2015-02-09 10:51  sun\misc\base64Decoder.java
     文件        4175  2015-02-09 10:52  sun\misc\base64Encoder.java
     文件         168  2015-02-09 10:52  sun\misc\CEFormatException.java
     文件         112  2015-02-09 10:52  sun\misc\CEStreamExhausted.java
     文件        8647  2015-02-09 10:52  sun\misc\CharacterDecoder.java
     文件       11941  2015-02-09 10:52  sun\misc\CharacterEncoder.java

评论

共有 条评论