Package es.gob.afirma.mreport.utils
Class UtilsBase64
- java.lang.Object
-
- es.gob.afirma.mreport.utils.UtilsBase64
-
public class UtilsBase64 extends java.lang.ObjectUtility class for encoding in base 64.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.0, 25/08/2020.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classUtilsBase64.InputStreamClass for reading the encoded bytes..classUtilsBase64.OutputStreamClass for storing the encoded bytes.
-
Field Summary
Fields Modifier and Type Field Description static byteBAD_ENCODINGstatic booleanDECODEstatic booleanENCODEstatic byteEQUALS_SIGNstatic byteEQUALS_SIGN_ENCstatic intMAX_LINE_LENGTHstatic byteNEW_LINEstatic byteWHITE_SPACE_ENC
-
Constructor Summary
Constructors Constructor Description UtilsBase64()Constructor method for the class UtilsBase64.java.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decode(byte[] abyte0, int i, int j)Decodes the supplied bytes.byte[]decode(java.lang.String s)Decodes the supplied string.java.lang.StringencodeBytes(byte[] abyte0)Encodes the supplied bytes.java.lang.StringencodeBytes(byte[] abyte0, int i, int j)Encodes the supplied bytes in the specified range.java.lang.StringencodeObject(java.io.Serializable serializable)Encodes the supplied object.java.lang.StringencodeString(java.lang.String s)Encodes the supplied string.booleanisBase64(java.lang.String encodedStr)
-
-
-
Field Detail
-
ENCODE
public static final boolean ENCODE
- See Also:
- Constant Field Values
-
DECODE
public static final boolean DECODE
- See Also:
- Constant Field Values
-
MAX_LINE_LENGTH
public static final int MAX_LINE_LENGTH
- See Also:
- Constant Field Values
-
EQUALS_SIGN
public static final byte EQUALS_SIGN
- See Also:
- Constant Field Values
-
NEW_LINE
public static final byte NEW_LINE
- See Also:
- Constant Field Values
-
BAD_ENCODING
public static final byte BAD_ENCODING
- See Also:
- Constant Field Values
-
WHITE_SPACE_ENC
public static final byte WHITE_SPACE_ENC
- See Also:
- Constant Field Values
-
EQUALS_SIGN_ENC
public static final byte EQUALS_SIGN_ENC
- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeObject
public java.lang.String encodeObject(java.io.Serializable serializable)
Encodes the supplied object.- Parameters:
serializable- Serializable object.- Returns:
- Encoded result.
-
encodeBytes
public java.lang.String encodeBytes(byte[] abyte0)
Encodes the supplied bytes.- Parameters:
abyte0- Arrays of bytes.- Returns:
- Encoded result.
-
encodeBytes
public java.lang.String encodeBytes(byte[] abyte0, int i, int j)Encodes the supplied bytes in the specified range.- Parameters:
abyte0- Array of bytes to encode.i- Started index.j- Finished index.- Returns:
- Encoded result.
-
encodeString
public java.lang.String encodeString(java.lang.String s)
Encodes the supplied string.- Parameters:
s- string.- Returns:
- Encoded result.
-
decode
public byte[] decode(java.lang.String s)
Decodes the supplied string.- Parameters:
s- Encoded string.- Returns:
- Arrays of bytes.
-
decode
public byte[] decode(byte[] abyte0, int i, int j)Decodes the supplied bytes.- Parameters:
abyte0- Bytes to decode.i- Started index.j- Finished index.- Returns:
- Decoded bytes.
-
isBase64
public boolean isBase64(java.lang.String encodedStr)
-
-