Package org.apache.tomcat.util.buf


package org.apache.tomcat.util.buf

Buffers and Encodings

This package contains buffers and utils to perform encoding/decoding of buffers. That includes byte to char conversions, URL encodings, etc.

Encoding is a critical operation for performance. There are few tricks in this package - the C2B and B2C converters are caching an ISReader/OSWriter and keep everything allocated to do the conversions in any VM without any garbage.

This package must accommodate future extensions and additional converters ( most important: the nio.charset, which should be detected and used if available ). Also, we do have one hand-written UTF8Decoder, and other tuned encoders could be added.

My benchmarks ( I'm costin :-) show only small differences between C2B, B2C and hand-written codders/decoders, so UTF8Decoder may be disabled.