public byte[] encode1(final String s){
  final ByteArrayBuffer tmp=new ByteArrayBuffer(s.length());
  final int nwritten=uc.encode(s,tmp);
  final int npack=LongPacker.getByteLength(nwritten);
  final byte[] a=new byte[npack + nwritten];
  final DataOutputBuffer dob=new DataOutputBuffer(0,a);
  try {
    dob.packLong(nwritten);
    dob.append(tmp.array(),0,tmp.pos());
    return a;
  }
  finally {
    try {
      dob.close();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}

public byte [ ] encode1 ( final String s ) { final ByteArrayBuffer tmp = new ByteArrayBuffer ( s . length ( ) ) ; final int nwritten = uc . encode ( s , tmp ) ; final int npack = LongPacker . getByteLength ( nwritten ) ; final byte [ ] a = new byte [ npack + nwritten ] ; final DataOutputBuffer dob = new DataOutputBuffer ( 0 , a ) ; try { dob . packLong ( nwritten ) ; dob . append ( tmp . array ( ) , 0 , tmp . pos ( ) ) ; return a ; } finally { try { dob . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } }
encode a unicode string .
