public static void writeExtensionMedia(OutputStream theOs,String theStr) throws IOException {
  theOs.write(theStr.getBytes(StandardCharsets.UTF_8));
  theOs.write((byte)0x00);
}

public static void writeExtensionMedia ( OutputStream theOs , String theStr ) throws IOException { theOs . write ( theStr . getBytes ( StandardCharsets . UTF_8 ) ) ; theOs . write ( ( byte ) 0x00 ) ; }
writes an " extension media " in pdu format to the given output stream . it currently only handles ascii chars , but should be extended to work with other charsets .
