simplar C to Java string conversion