src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarHelper.java
/**
   * Writes an entry with specific contents to the jar. Directory entries must include the trailing
   * '/'.
   */
Writes an entry with specific contents to the jar. Directory entries must include the trailing
'/'.
Writes an entry with specific contents to the jar . Directory entries must include the trailing ' / ' .
protected void writeEntry(JarOutputStream out, String name, byte[] content) throws IOException {
    if (names.add(name)) {
      JarEntry entry = new JarEntry(name);
      entry.setTime(newEntryTimeMillis(name));
      int size = content.length;
      entry.setSize(size);
      if (size == 0) {
        entry.setMethod(JarEntry.STORED);
        entry.setCrc(0);
        out.putNextEntry(entry);
      } else {
        entry.setMethod(storageMethod);
        if (storageMethod == JarEntry.STORED) {
          CRC32 crc = new CRC32();
          crc.update(content);
          entry.setCrc(crc.getValue());
        }
        out.putNextEntry(entry);
        out.write(content);
      }
      out.closeEntry();
    }
  }
protected void writeEntry ( JarOutputStream out , String name , byte [ ] content ) throws IOException { if ( names . add ( name ) ) { JarEntry entry = new JarEntry ( name ) ; entry . setTime ( newEntryTimeMillis ( name ) ) ; int size = content . length ; entry . setSize ( size ) ; if ( size == 0 ) { entry . setMethod ( JarEntry . STORED ) ; entry . setCrc ( 0 ) ; out . putNextEntry ( entry ) ; } else { entry . setMethod ( storageMethod ) ; if ( storageMethod == JarEntry . STORED ) { CRC32 crc = new CRC32 ( ) ; crc . update ( content ) ; entry . setCrc ( crc . getValue ( ) ) ; } out . putNextEntry ( entry ) ; out . write ( content ) ; } out . closeEntry ( ) ; } }
Writes an entry with specific contents to the jar.
Writes an entry with specific contents to the jar .
// Create a new entry