code: public static void putString(IoBuffer buf, String string) {
          final byte[] encoded = encodeString(string);
          if (encoded.length < AMF.LONG_STRING_LENGTH) {
              // write unsigned short
              buf.put((byte) ((encoded.length >> 8) & 0xff));
              buf.put((byte) (encoded.length & 0xff));
          } else {
              buf.putInt(encoded.length);
          }
          buf.put(encoded);
      }
docs: Write out string
  
  @param buf
  Byte buffer to write to
  @param string
  String to write