More Related Content
Similar to Apache Commons ソースリーディングの会:Codec
Similar to Apache Commons ソースリーディングの会:Codec (20)
Apache Commons ソースリーディングの会:Codec
- 6. • org.apache.commons.codec.binary
-
- Base64 / Hex / Binary Codec
• org.apache.commons.codec.digest
- MD5 SHA1
• org.apache.commons.codec.language
-
- Soundex / Metaphone
• org.apache.commons.codec.net
-
- URLCodec(URL Encode) / Quoted Printable Codec /
BCodec / QCodec
- 8. org.apache.commons.codec
•
• Exception
- Encoder / Decoder
- BinaryEncoder / BinaryDecoder
- StringEncoder / StringDecoder
- StringEncoderComparator
- DecoderException / EncoderException
- CharEncoding(charset )
- 12. Base64 Encoding
•
• [0-9a-zA-Z+/]
• Commons Codec
• STANDARD_ENCODE_TABLE
• [0-9a-zA-Z+/]
• URL_SAFE_ENCODE_TABLE
• [0-9a-zA-Z-_]
• RFC
http://www.ietf.org/rfc/rfc2045.txt
- 13. •
• urlSafe:boolean
• lineLength:int
• lineLength:int, lineSeparator:byte[]
• lineLength:int, lineSeparator:byte[],
urlSafe:boolean
- 14. • lineLength
•
• 76
• RFC2045 section 6.8.
http://tools.ietf.org/html/rfc2045#section-6.8
- 15. • lineSeparator
•
• CRLF rn
• RFC2045 section 2.1.
http://tools.ietf.org/html/rfc2045#section-2.1
mail RFC RF822
- 16. • urlSafe
•
• true:URL_SAFE_ENCODE_TABLE
• false:STANDARD_ENCODE_TABLE
(default)
- 22. encodeBase64
•
• null
• maxResultSize
• Base64
• encode
• null
•
• EOF
•
- 26. Hex
• 16 char
• LOWER or UPPER
•
- 31. MessageDigest?
•
• MD5 SHA1
• Java java.security.MessageDigest
• DigestUtils MessageDigest
- 32. DigestUtils
•
• MD5 SHA1 SHA256 SHA384 SHA51
2
•
• Stream UTF-8
•
• 16
- 34. org.apache.commons.codec.language
• Phonetic Algorithm
※Phonetic Algorithm:
- StringEncoder
- Soundex
- Metaphone
- RefinedSoundex
- DoubleMetaphone
- Caverphone
- SoundexUtils
- 35. Soundex
•
•
•
• Soundex
• “Robert”,”Rupert” → R163
- 38. org.apache.commons.codec.net
•
- BinaryEncoder / BinaryDecoder / StringEncoder /
StringDecoder
- URLCodec
- QuotedPrintableCodec
- RFC1522Codec
- QCodec
- BCodec
- Utils
- 39. URLCodec
• URL
• java.net.URLEncoder / URLDecoder
• Commons Codec
•
URLCodec QuotedPrintable
- 41. encode
• bytes:byte[]
• pObject:Object
• pString:String
• pString:String, charset:String
• charset
charset
- 42. encode
•
•
•
• URL Safe
ʼ+ʼ
• URL Safe:[0-9a-zA-Z-_.* ]
• URL Safe
ʼ%ʼ + 16
- 43. decode
• bytes:byte[]
• pObject:Object
• pString:String
• pString:String, charset:String
• charset
charset
- 44. decode
•
•
•
• URL Safe
ʼ+ʼ
• URL Safe:[0-9a-zA-Z-_.* ]
• URL Safe ʼ%ʼ
- 45. org.apache.commons.codec.net
•
- BinaryEncoder / BinaryDecoder / StringEncoder /
StringDecoder
- URLCodec
- QuotedPrintableCodec
- RFC1522Codec
- QCodec
- BCodec
- Utils
- 48. encode
• bytes:byte[]
• pObject:Object
• pString:String
• pString:String, charset:String
• charset
charset
- 50. decode
• bytes:byte[]
• pObject:Object
• pString:String
• pString:String, charset:String
• charset
charset
- 52. org.apache.commons.codec.net
•
- BinaryEncoder / BinaryDecoder / StringEncoder /
StringDecoder
- URLCodec
- QuotedPrintableCodec
- RFC1522Codec
- QCodec
- BCodec
- Utils
- 53. RFC1522Codec
• RFC1521 1522 MIME RFC
• ASCII
• RFC1522Codec
• [sample] =?ISO-2022-JP?B?GyRCJD8hIxsoQg==?=
• QCodec:Quoted Printable
• BCodec:Base64
• BCodec
- 56. encode
•
• PREFIX (“=?”)
• charset
• (ʻ?ʼ)
• (QCodec ʼQʼ)
• (ʻ?ʼ)
• Quoted Printable
• POSTFIX (“?=”)
- 58. decode
•
• PREFIX POSTFIX
• charset
(QCodec or BCodec)
•