code: public Serializer writeString(String value) throws IOException {
          if (null == value) return writeNull();
  
          writer.write('"');
  
          char[] chars = value.toCharArray();
  
          for (int i=0; i<chars.length; i++)
          {
              char c = chars[i];
              switch (c)
              {
                  case  '"': writer.write("\\\""); break;
                  case '\\': writer.write("\\\\"); break;
                  case    0: writer.write("\\u0000"); break;
                  case '\b': writer.write("\\b"); break;
                  case '\t': writer.write("\\t"); break;
                  case '\n': writer.write("\\n"); break;
                  case '\f': writer.write("\\f"); break;
                  case '\r': writer.write("\\r"); break;
                  case '/': writer.write("\\/"); break;
                  default:
                      if ((c >= 32) && (c <= 126))
                      {
                          writer.write(c);
                      }
                      else
                      {
                          writer.write("\\u");
                          writer.write(rightAlignedZero(Integer.toHexString(c),4));
                      }
              }
          }
  
          writer.write('"');
  
          return this;
      }
docs: Method to write a String out to the writer, encoding special characters and unicode characters properly.
  @param value The string to write out.
  @throws IOException Thrown if an error occurs during write.