public HeapDataOutputStream(String s){
  int maxStrBytes;
  if (ASCII_STRINGS) {
    maxStrBytes=s.length();
  }
 else {
    maxStrBytes=s.length() * 3;
  }
  this.MIN_CHUNK_SIZE=INITIAL_CAPACITY;
  this.buffer=ByteBuffer.allocate(maxStrBytes);
  this.doNotCopy=false;
  writeUTFNoLength(s);
}

public HeapDataOutputStream ( String s ) { int maxStrBytes ; if ( ASCII_STRINGS ) { maxStrBytes = s . length ( ) ; } else { maxStrBytes = s . length ( ) * 3 ; } this . MIN_CHUNK_SIZE = INITIAL_CAPACITY ; this . buffer = ByteBuffer . allocate ( maxStrBytes ) ; this . doNotCopy = false ; writeUTFNoLength ( s ) ; }
create a heapdataoutputstream optimized to contain just the specified string . the string will be written to this stream encoded as utf .
