code: public String getContentReplayPrefixString(int size, Charset cs) {
          try {
              InputStreamReader isr =  new InputStreamReader(getContentReplayInputStream(), cs); 
              char[] chars = new char[size];
              int count = isr.read(chars);
              isr.close(); 
              if (count > 0) {
                  return new String(chars,0,count);
              } else {
                  return "";
              }
          } catch (IOException e) {
              logger.log(Level.SEVERE,"unable to get replay prefix string", e);
              return ""; 
          } 
      }
docs: Return a short prefix of the presumed-textual content as a String.
  
  @param size max length of String to return
  @return String prefix, or empty String (with logged exception) on any error