code: public static final String getString(byte[] data, int offset)
     {
        StringBuilder buffer = new StringBuilder();
        char c;
  
        for (int loop = 0; offset + loop < data.length; loop++)
        {
           c = (char) data[offset + loop];
  
           if (c == 0)
           {
              break;
           }
  
           buffer.append(c);
        }
  
        return (buffer.toString());
     }
docs: Reads a string of single byte characters from the input array.
  This method assumes that the string finishes either at the
  end of the array, or when char zero is encountered.
  Reading begins at the supplied offset into the array.
  
  @param data byte array of data
  @param offset offset into the array
  @return string value