public String encode(byte aBuffer[]){
  ByteArrayOutputStream outStream=new ByteArrayOutputStream();
  ByteArrayInputStream inStream=new ByteArrayInputStream(aBuffer);
  String retVal=null;
  try {
    encode(inStream,outStream);
    retVal=outStream.toString("8859_1");
  }
 catch (  Exception IOException) {
    throw new Error("CharacterEncoder.encode internal error");
  }
  return (retVal);
}

public String encode ( byte aBuffer [ ] ) { ByteArrayOutputStream outStream = new ByteArrayOutputStream ( ) ; ByteArrayInputStream inStream = new ByteArrayInputStream ( aBuffer ) ; String retVal = null ; try { encode ( inStream , outStream ) ; retVal = outStream . toString ( "8859_1" ) ; } catch ( Exception IOException ) { throw new Error ( "CharacterEncoder.encode internal error" ) ; } return ( retVal ) ; }
a ' streamless ' version of encode that simply takes a buffer of bytes and returns a string containing the encoded buffer .
