Prints a string to the stream, encoded as UTF-8 with preceeding length

@param v the string to print.
774141
public void printLenString(String v)
        throws IOException
    {
        if (SIZE < _offset + 16)
            flushBuffer();

        if (v == null) {
            _buffer[_offset++] = (byte) (0);
            _buffer[_offset++] = (byte) (0);
        }
        else {
            int len = v.length();
            _buffer[_offset++] = (byte) (len >> 8);
            _buffer[_offset++] = (byte) (len);

            printString(v, 0, len);
        }
    }
100142
public void writeString(String string) throws IOException {
        if (string == null) {
            writeInt(VoltType.NULL_STRING_LENGTH);
            return;
        }

        byte[]  strbytes = string.getBytes(Constants.UTF8ENCODING);
        int len = strbytes.length;

        writeInt(len);
        write(strbytes);
    }
1244666
public static void writeUTF8WithLength(OutputStream out, String str) throws IOException {
        byte[] s = str.getBytes(UTF8);
        writeInt4(out, s.length);
        out.write(s);
    }
274734
public static String readStreamToString(InputStream is, String encoding) throws IOException {
		try {
			StringBuilder sb = new StringBuilder();
			byte[] buf = new byte[1024 * 10];
			int read;
			while ((read = is.read(buf)) >= 0) {
				sb.append(new String(buf, 0, read, encoding));
			}
			return sb.toString();
		} finally {
			is.close();
		}
	}
362453
public static final void format(StringBuilder sb, double v, String format)
    {
        sb.append(String.format(Locale.US, format, v));
        int length = sb.length();
        while (true)
        {
            char cc = sb.charAt(length-1);
            if (cc == '.')
            {
                length--;
                break;
            }
            if (cc != '0')
            {
                break;
            }
            length--;
        }
        sb.setLength(length);
    }
1129238
protected void writeUTF(int code, String string)
        throws IOException
    {
        OutputStream os = getOutputStream();

        os.write(code);

        int charLength = string.length();

        int length = 0;
        for (int i = 0; i < charLength; i++) {
            char ch = string.charAt(i);

            if (ch < 0x80)
                length++;
            else if (ch < 0x800)
                length += 2;
            else
                length += 3;
        }

        os.write(length >> 8);
        os.write(length);

        for (int i = 0; i < length; i++) {
            char ch = string.charAt(i);

            if (ch < 0x80)
                os.write(ch);
            else if (ch < 0x800) {
                os.write(0xc0 + (ch >> 6) & 0x1f);
                os.write(0x80 + (ch & 0x3f));
            }
            else {
                os.write(0xe0 + (ch >> 12) & 0xf);
                os.write(0x80 + ((ch >> 6) & 0x3f));
                os.write(0x80 + (ch & 0x3f));
            }
        }
    }
955768
final public void println(float v)
  {
    String s = String.valueOf(v);
    
    write(s, 0, s.length());
    println();
  }
1323954
private void write(final int val)
		throws EncodingException
	{

		if (val < 0 || val > 255) {
			throw ErrorFactory.createEncodingException(
					ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
					"byte value out of range: " + val);
		}

		this.stream.write(val);
	}
698101
final public void println(long v)
  {
    Writer out = this.out;
    if (out == null)
      return;

    print(v);

    try {
      out.write(_newline, 0, _newline.length);
    } catch (IOException e) {
      log.log(Level.FINE, e.toString(), e);
    }
  }
744129
public void print(String value) throws IOException
  {
    if(value!=null) {
        this.output.write(value.getBytes(), 0, value.length());        
    }
  }
464022
public void setEncoding(String v) {
    if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_encoding == null)
      jcasType.jcas.throwFeatMissing("encoding", "de.julielab.jules.types.ace.SourceFile");
    jcasType.ll_cas.ll_setStringValue(addr, ((SourceFile_Type)jcasType).casFeatCode_encoding, v);}
1152220
public static void writeUTF8(OutputStream out, String str) throws IOException {
        byte[] s = str.getBytes(UTF8);
        out.write(s);
    }
407420
public void writeVInt(int value) {
        if(value < 0) {
            writeByte((byte)0x80);
            return;
        }

        if(value > 0x0FFFFFFF) writeByte((byte)(0x80 | ((value >>> 28))));
        if(value > 0x1FFFFF)   writeByte((byte)(0x80 | ((value >>> 21) & 0x7F)));
        if(value > 0x3FFF)     writeByte((byte)(0x80 | ((value >>> 14) & 0x7F)));
        if(value > 0x7F)       writeByte((byte)(0x80 | ((value >>>  7) & 0x7F)));

        writeByte((byte)(value & 0x7F));
    }
776919
public static void logPrintf(String format, String... v) {
        if (enableLog) {
            String tmp = String.format(format, (Object[]) v);
            logger.log(Level.INFO, tmp);
        }
    }
783808
final public void print(Object v)
  {
    if (v == null)
      write(_nullChars, 0, _nullChars.length);
    else {
      String s = v.toString();
      
      write(s, 0, s.length());
    }
  }
555891
public void print(String s) throws IOException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        { // 306998.15
            Tr.debug(tc, "print --> " + s);
        }
        if (!_hasWritten && obs != null)
        {
            _hasWritten = true;
            obs.alertFirstWrite();
        }
        int len = s.length();
        if (limit > -1)
        {
            if (total + len > limit)
            {
                len = (int)(limit - total);
                except = new WriteBeyondContentLengthException();
            }
        }

        int off = 0;
        while (len > 0)
        {
            int n = buf.length - count;
            if (n == 0)
            {
                response.setFlushMode(false);
                flushChars();
                response.setFlushMode(true);
                n = buf.length - count;
            }
            if (n > len)
            {
                n = len;
            }

            s.getChars(off, off + n, buf, count);

            count += n;
            total += n;
            off += n;
            len -= n;
        }
        check();
    }
595364
private void writeSimpleString(OutputStream out, CharSequence value) throws IOException {
        out.write('"');
        for (int i = 0; i < value.length(); i++) {
            out.write(value.charAt(i));
        }
        out.write('"');
    }