All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.jclark.xml.tok.StringConversionCache

java.lang.Object
   |
   +----com.jclark.xml.tok.StringConversionCache

public class StringConversionCache
extends Object
Caches conversion of byte subarrays into Strings.


Constructor Index

 o StringConversionCache(Encoding)
Create a cache of the default size for converting byte subarrays in the specified encoding into Strings.
 o StringConversionCache(Encoding, int)
Create a cache of the specified size for converting byte subarrays in the specified encoding into Strings.

Method Index

 o convert(byte[], int, int, boolean)
Convert a byte subarray into a String.
 o setEncoding(Encoding)
Changes the encoding for the cache.

Constructors

 o StringConversionCache
 public StringConversionCache(Encoding enc,
                              int cacheSize)
Create a cache of the specified size for converting byte subarrays in the specified encoding into Strings.

 o StringConversionCache
 public StringConversionCache(Encoding enc)
Create a cache of the default size for converting byte subarrays in the specified encoding into Strings.

Methods

 o setEncoding
 public void setEncoding(Encoding enc)
Changes the encoding for the cache. This cannot be called after any calls to convert have been made.

 o convert
 public String convert(byte buf[],
                       int start,
                       int end,
                       boolean permanent)
Convert a byte subarray into a String. If permanent is true, then this conversion will be kept in the cache in preference to any non-permanent conversions.


All Packages  Class Hierarchy  This Package  Previous  Next  Index