private void writeHeader(OutputStream docOS) throws IOException {
  IOUtils.write("#FORMAT=WebAnno TSV 3" + LF,docOS,encoding);
  for (  String type : featurePerLayer.keySet()) {
    String annoType;
    if (spanLayers.contains(type)) {
      annoType=SP;
    }
 else     if (relationLayers.contains(type)) {
      annoType=RL;
    }
 else {
      annoType=CH;
    }
    IOUtils.write("#" + annoType + "="+ type+ "|",docOS,encoding);
    StringBuffer fsb=new StringBuffer();
    for (    String feature : featurePerLayer.get(type)) {
      if (fsb.length() < 1) {
        fsb.append(feature);
      }
 else {
        fsb.append("|" + feature);
      }
    }
    IOUtils.write(fsb.toString() + LF,docOS,encoding);
  }
  IOUtils.write(LF,docOS,encoding);
}

private void writeHeader ( OutputStream docOS ) throws IOException { IOUtils . write ( "#FORMAT=WebAnno TSV 3" + LF , docOS , encoding ) ; for ( String type : featurePerLayer . keySet ( ) ) { String annoType ; if ( spanLayers . contains ( type ) ) { annoType = SP ; } else if ( relationLayers . contains ( type ) ) { annoType = RL ; } else { annoType = CH ; } IOUtils . write ( "#" + annoType + "=" + type + "|" , docOS , encoding ) ; StringBuffer fsb = new StringBuffer ( ) ; for ( String feature : featurePerLayer . get ( type ) ) { if ( fsb . length ( ) < 1 ) { fsb . append ( feature ) ; } else { fsb . append ( "|" + feature ) ; } } IOUtils . write ( fsb . toString ( ) + LF , docOS , encoding ) ; } IOUtils . write ( LF , docOS , encoding ) ; }
write headers , in the sequence < br > type tab list ( features sep by tab )
