int data = theIs.read();  if (data == -1) { throw new IOException("Unexpected end of stream"); }  rest |= (data << restBits); restBits += 8;  while (restBits >= 7) { msg.append(fromGsmCharset((byte)(rest & 0x7f)));  rest >>>= 7; restBits -= 7; } }  return msg.toString();
return readSeptets(new ByteArrayInputStream(theArray), theLength); } catch (IOException ex) {  return null; }
    public static String readSeptets(InputStream theIs, int theLength)        throws IOException    {        StringBuffer msg = new StringBuffer(160);        int rest = 0;        int restBits = 0;        while(msg.length() < theLength)        {            int data = theIs.read();            if (data == -1)            {                throw new IOException("Unexpected end of stream");            }            rest |= (data << restBits);            restBits += 8;            while (restBits >= 7)            {                msg.append(fromGsmCharset((byte)(rest & 0x7f)));                rest >>>= 7;                restBits -= 7;            }        } // for        return msg.toString();    }