protected void write(Attributes attributes, DataOutputStream os) throws IOException { Iterator it = attributes.entrySet().iterator(); while (it.hasNext()) { Map.Entry e = (Map.Entry) it.next(); StringBuffer buffer = new StringBuffer(((Attributes.Name) e.getKey()).toString()); buffer.append(": "); //$NON-NLS-1$ buffer.append(toUtf8((String) e.getValue())); buffer.append("\r\n"); //$NON-NLS-1$ localMake72Safe(buffer); os.writeBytes(buffer.toString()); } os.writeBytes("\r\n"); //$NON-NLS-1$ }
/** * Writes the Manifest to the specified OutputStream, splitting each classpath entry on a line * by itself. * * @param out * the output stream * @exception IOException * if an I/O error has occurred */ public void writeSplittingClasspath(OutputStream out) throws IOException { DataOutputStream dos = new DataOutputStream(out); // Write out the main attributes for the manifest writeMainSplittingClasspath(getMainAttributes(), dos); // Now write out the pre-entry attributes Iterator it = getEntries().entrySet().iterator(); while (it.hasNext()) { Map.Entry e = (Map.Entry) it.next(); StringBuffer buffer = new StringBuffer("Name: "); //$NON-NLS-1$ buffer.append((String) e.getKey()); buffer.append("\r\n"); //$NON-NLS-1$ localMake72Safe(buffer); dos.writeBytes(buffer.toString()); write((Attributes) e.getValue(), dos); } dos.flush(); }
protected void writeSplit(DataOutputStream out, String name, String value) throws IOException { StringTokenizer tok = new StringTokenizer(value); int inc = 0; while (tok.hasMoreTokens()) { StringBuffer buffer = null; if (inc == 0) { buffer = new StringBuffer(name); buffer.append(": "); //$NON-NLS-1$ } else { buffer = new StringBuffer(); buffer.append(' '); } buffer.append(tok.nextToken()); if (tok.countTokens() > 0) buffer.append(" \r\n"); //$NON-NLS-1$ else buffer.append("\r\n"); //$NON-NLS-1$ localMake72Safe(buffer); out.writeBytes(buffer.toString()); inc++; } }
buffer.append(toUtf8((String) e.getValue())); buffer.append("\r\n"); //$NON-NLS-1$ localMake72Safe(buffer); out.writeBytes(buffer.toString());