Class Base64Decoder

java.lang.Object
org.miaixz.bus.core.codec.binary.decoder.Base64Decoder
All Implemented Interfaces:
Serializable, Decoder<byte[],byte[]>

public class Base64Decoder extends Object implements Decoder<byte[],byte[]>, Serializable
Base64解码实现 此解码保留的原因是,JDK提供的解码需要指定是否为URL安全的或是否换行,此解码无需区分
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Field Details

  • Constructor Details

    • Base64Decoder

      public Base64Decoder()
  • Method Details

    • decode

      public byte[] decode(byte[] in)
      解码Base64
      Specified by:
      decode in interface Decoder<byte[],byte[]>
      Parameters:
      in - 输入
      Returns:
      解码后的bytes
    • decode

      public byte[] decode(byte[] in, int pos, int length)
      解码Base64
      Parameters:
      in - 输入
      pos - 开始位置
      length - 长度
      Returns:
      解码后的bytes
    • isBase64Code

      public boolean isBase64Code(byte octet)
      给定的字符是否为Base64字符
      Parameters:
      octet - 被检查的字符
      Returns:
      是否为Base64字符