Read about convert file to base64 encoded string java, The latest news, videos, and discussion topics about convert file to base64 encoded string java from alibabacloud.com
Base64 is one of the most common encoding methods for transmitting 8Bit bytes of code on the network, and you can view rfc2045~rfc2049, which has a detailed specification of MIME. BASE64 encoding can be used to pass longer identity information in an
Base64 Basic Algorithm principle
String instance (Base64 codec for S13)Test: S13Code: CzezDecoding: S13
How to encode the process analysis of S13 for Czez:
BASE64 requires converting every three 8Bit bytes to four 6Bit bytes (3*8 = 4*6 = 24), and
Base64 is one of the most common encoding methods for transmitting 8Bit bytes of code on the network , and you can view rfc2045~rfc2049, which has a detailed specification of MIME. BASE64 encoding can be used to pass longer identity information in
/**
@Descriptionmap Convert a picture file to a byte array string and encode it Base64
@author Temdy
@Date 2015-01-26
Path to @param path picture
@return*/public static string ImageToBase64 (string path) {//Converts the
I. Brief description
MD5: All called message digest algorithm 5 (Information digest algorithm), can be encrypted, but not decrypted, belong to one-way encryption, usually used for file verification
BASE64: The 8-bit byte of any sequence is
A function used in a project to convert Base64 picture data to a local picture
/** * Replaces base64 picture data in HTML for actual picture * @param HTML * @param fileroot Local Path * @param serroot Server path * @return/Public
static string
How to use:
The following IMG is taken over by Base64 encoded pictures
To store this picture.String img=request.getparameter ("img");System.out.print (img+ "= =");Typeconverter.generateimage (IMG);
public class TypeConverter {//Picture into Base64
Base64 is one of the most common encoding methods used to transmit 8-bit code on the network. For details, refer to RFC2045 ~ RFC2049, which has the MIME detailed specification. Base64 encoding can be used to transmit long identification information
One, base64 picture codecBasic process: Download a picture from the network, then Base64 encoding, and then base64 decoding, stored in the local e-packing directory.
One, base64 picture codecBasic flow: Download a picture from the network. Then base64 encoding, and then base64 decoding, stored in the local e-packing folder.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.