Sets the value of the StringValue to a substring of the given value.

@param chars The new string value (as a character array).
@param offset The position to start the substring.
@param len The length of the substring.
558172
public void setValue(char[] chars, int offset, int len) {
		checkNotNull(chars);
		if (offset < 0 || len < 0 || offset > chars.length - len) {
			throw new IndexOutOfBoundsException();
		}

		ensureSize(len);
		System.arraycopy(chars, offset, this.value, 0, len);
		this.len = len;
		this.hashCode = 0;
	}
1207836
public void setStringListValues(java.util.Collection<String> stringListValues) {
        if (stringListValues == null) {
            this.stringListValues = null;
            return;
        }

        this.stringListValues = new com.amazonaws.internal.SdkInternalList<String>(stringListValues);
    }
575042
protected int getDateValueOffset(String offsetString, char c) {
        ArrayList<Character> charList = new ArrayList<Character>();

        int index = offsetString.indexOf(c);
        if (index != -1) {
            for (int i = index-1; i >= 0; i--) {
                if (Character.isDigit(offsetString.charAt(i))) {
                    charList.add(0, offsetString.charAt(i));
                } else {

                    StringBuffer offsetValue = new StringBuffer();
                    offsetValue.append("0");
                    for (int j = 0; j < charList.size(); j++) {
                        offsetValue.append(charList.get(j));
                    }

                    if (offsetString.charAt(i) == '-') {
                        return Integer.valueOf("-" + offsetValue.toString());
                    } else {
                        return Integer.valueOf(offsetValue.toString());
                    }
                }
            }
        }

        return 0;
    }
83874
public static Optional<OffsetRange<CharOffset>> charOffsetsOfWholeString(String s) {
    if (s.isEmpty()) {
      return Optional.absent();
    }
    return Optional.of(charOffsetRange(0, s.length() - 1));
  }
967819
public static String randomString( char[] values, int len )
    {
        Random rnd = new SecureRandom();
        StringBuilder sb = new StringBuilder( len );
        for ( int i = 0; i < len; i++ ) {
            sb.append( values[ rnd.nextInt( values.length )] );
        }
        return sb.toString();
    }
844053
public void setString(String str) throws IOException {
        Reader r = new StringReader(str);
        int    c;
        reset();
        while (((c = r.read()) != 0) && (c != -1)) {
            write(c);
        }
    }
928089
public void setStringSetValue(java.util.Collection<String> stringSetValue) {
        if (stringSetValue == null) {
            this.stringSetValue = null;
            return;
        }

        this.stringSetValue = new com.amazonaws.internal.SdkInternalList<String>(stringSetValue);
    }
864478
@Override
	public void setValue(StringValue value) {
		Validate.notNull(value);
		setValue(value.value, 0, value.len);
	}
351011
public void write(String s,int offset, int length)
        throws IOException
    {
        for (int i=0;i<length;i++)
            _buffer.append(s.charAt(offset+i));
    }
966565
public void write(char text[], int offset, int length) {
        if ((offset < 0) || (offset > text.length) || (length < 0) || ((offset + length) > text.length) || ((offset + length) < 0)) {
            throw new IndexOutOfBoundsException();
        }
        else if (length == 0) {
            return;
        }
        buffer.append(text, offset, length);
    }
1044779
private final void _writeString(char[] text, int offset, int len)
        throws IOException, JsonGenerationException
    {
        if (_maximumNonEscapedChar != 0) {
            _writeStringASCII(text, offset, len, _maximumNonEscapedChar);
            return;
        }
        
        /* Let's just find longest spans of non-escapable
         * content, and for each see if it makes sense
         * to copy them, or write through
         */
        len += offset; // -> len marks the end from now on
        final int[] escCodes = _outputEscapes;
        final int escLen = escCodes.length;
        while (offset < len) {
            int start = offset;

            while (true) {
                char c = text[offset];
                if (c < escLen && escCodes[c] != 0) {
                    break;
                }
                if (++offset >= len) {
                    break;
                }
            }

            // Short span? Better just copy it to buffer first:
            int newAmount = offset - start;
            if (newAmount < SHORT_WRITE) {
                // Note: let's reserve room for escaped char (up to 6 chars)
                if ((_outputTail + newAmount) > _outputEnd) {
                    _flushBuffer();
                }
                if (newAmount > 0) {
                    System.arraycopy(text, start, _outputBuffer, _outputTail, newAmount);
                    _outputTail += newAmount;
                }
            } else { // Nope: better just write through
                _flushBuffer();
                _writer.write(text, start, newAmount);
            }
            // Was this the end?
            if (offset >= len) { // yup
                break;
            }
            // Nope, need to escape the char.
            char c = text[offset++];
            _appendCharacterEscape(c, escCodes[c]);          
        }
    }
522066
public static int indexFrom(String s,String chars)
    {
        for (int i=0;i<s.length();i++)
           if (chars.indexOf(s.charAt(i))>=0)
              return i;
        return -1;
    }
976672
public void encodeString(final String s) throws IOException {
		final int lenChars = s.length();
		final int lenCharacters = s.codePointCount(0, lenChars);
		encodeUnsignedInteger(lenCharacters);
		encodeStringOnly(s);
	}
806568
private final void setto(String s) {
        int l = s.length(); 
        int o = j+1;
        for (int i = 0; i < l; i++)
            sb.setCharAt(o+i, s.charAt(i));
        k = j+l;
    }
760117
private void emitStringValue(String s) {
    raw('"');
    char b = 0, c = 0;
    for (int i = 0; i < s.length(); i++) {
      b = c;
      c = s.charAt(i);

      switch (c) {
        case '\\':
        case '"':
          raw('\\');
          raw(c);
          break;
        case '/':
          // Special case to ensure that </script> doesn't appear in JSON
          // output
          if (b == '<')
            raw('\\');
          raw(c);
          break;
        case '\b':
          raw("\\b");
          break;
        case '\t':
          raw("\\t");
          break;
        case '\n':
          raw("\\n");
          break;
        case '\f':
          raw("\\f");
          break;
        case '\r':
          raw("\\r");
          break;
        default:
          if (shouldBeEscaped(c)) {
            String t = "000" + Integer.toHexString(c);
            raw("\\u" + t.substring(t.length() - "0000".length()));
          } else {
            raw(c);
          }
      }
    }

    raw('"');
  }
264915
public void setValue(CharSequence value, int offset, int len) {
		checkNotNull(value);
		if (offset < 0 || len < 0 || offset > value.length() - len) {
			throw new IndexOutOfBoundsException("offset: " + offset + " len: " + len + " value.len: " + len);
		}

		ensureSize(len);
		this.len = len;		
		for (int i = 0; i < len; i++) {
			this.value[i] = value.charAt(offset + i);
		}
		this.hashCode = 0;
	}
676283
public void putString(int pos, CharSequence s) {
		for (int i = 0; i < s.length(); ++i) {
			char c = s.charAt(i);
			byte b0 = (byte)c;
			byte b1 = (byte)(c >> 8);
			if (_order == ByteOrder.BIG_ENDIAN) {
				putBytes(pos, b1, b0);
			} else {
				putBytes(pos, b0, b1);
			}
			pos += 2;
		}
	}