public void printString(String v,int strOffset,int length) throws IOException {
  int offset=_offset;
  byte[] buffer=_buffer;
  for (int i=0; i < length; i++) {
    if (SIZE <= offset + 16) {
      _offset=offset;
      flushBuffer();
      offset=_offset;
    }
    char ch=v.charAt(i + strOffset);
    if (ch < 0x80)     buffer[offset++]=(byte)(ch);
 else     if (ch < 0x800) {
      buffer[offset++]=(byte)(0xc0 + ((ch >> 6) & 0x1f));
      buffer[offset++]=(byte)(0x80 + (ch & 0x3f));
    }
 else {
      buffer[offset++]=(byte)(0xe0 + ((ch >> 12) & 0xf));
      buffer[offset++]=(byte)(0x80 + ((ch >> 6) & 0x3f));
      buffer[offset++]=(byte)(0x80 + (ch & 0x3f));
    }
  }
  _offset=offset;
}

public void printString ( String v , int strOffset , int length ) throws IOException { int offset = _offset ; byte [ ] buffer = _buffer ; for ( int i = 0 ; i < length ; i ++ ) { if ( SIZE <= offset + 16 ) { _offset = offset ; flushBuffer ( ) ; offset = _offset ; } char ch = v . charAt ( i + strOffset ) ; if ( ch < 0x80 ) buffer [ offset ++ ] = ( byte ) ( ch ) ; else if ( ch < 0x800 ) { buffer [ offset ++ ] = ( byte ) ( 0xc0 + ( ( ch > > 6 ) & 0x1f ) ) ; buffer [ offset ++ ] = ( byte ) ( 0x80 + ( ch & 0x3f ) ) ; } else { buffer [ offset ++ ] = ( byte ) ( 0xe0 + ( ( ch > > 12 ) & 0xf ) ) ; buffer [ offset ++ ] = ( byte ) ( 0x80 + ( ( ch > > 6 ) & 0x3f ) ) ; buffer [ offset ++ ] = ( byte ) ( 0x80 + ( ch & 0x3f ) ) ; } } _offset = offset ; }
prints a string to the stream , encoded as utf - 8
