public static String encode(byte[] data,int start,int length) throws ArrayIndexOutOfBoundsException {
  StringWriter out=new StringWriter();
  ByteArrayInputStream in=new ByteArrayInputStream(data,start,length);
  try {
    encode(in,out);
    in.close();
    out.flush();
    out.close();
  }
 catch (  IOException ioe) {
    return ioe.toString();
  }
  return out.toString();
}

public static String encode ( byte [ ] data , int start , int length ) throws ArrayIndexOutOfBoundsException { StringWriter out = new StringWriter ( ) ; ByteArrayInputStream in = new ByteArrayInputStream ( data , start , length ) ; try { encode ( in , out ) ; in . close ( ) ; out . flush ( ) ; out . close ( ) ; } catch ( IOException ioe ) { return ioe . toString ( ) ; } return out . toString ( ) ; }
description of the method
