Tabnine Logo
LEDataOutputStream
Code IndexAdd Tabnine to your IDE (free)

How to use
LEDataOutputStream
in
de.schlichtherle.truezip.io

Best Java code snippets using de.schlichtherle.truezip.io.LEDataOutputStream (Showing top 10 results out of 315)

origin: de.schlichtherle.truezip/truezip-driver-zip

final long cdEntries = entries.size();
final long cdOffset = this.cdOffset;
final long cdSize = dos.size() - cdOffset;
final boolean cdEntriesZip64 = cdEntries > UShort.MAX_VALUE || FORCE_ZIP64_EXT;
final boolean cdSizeZip64    = cdSize    > UInt  .MAX_VALUE || FORCE_ZIP64_EXT;
if (zip64) {
  final long zip64eocdOffset // relative offset of the zip64 end of central directory record
      = dos.size();
  dos.writeInt(ZIP64_EOCDR_SIG);
  dos.writeLong(ZIP64_EOCDR_MIN_LEN - 12);
  dos.writeShort(63);
  dos.writeShort(46); // due to potential use of BZIP2 compression
  dos.writeInt(0);
  dos.writeInt(0);
  dos.writeLong(cdEntries);
  dos.writeLong(cdEntries);
  dos.writeLong(cdSize);
  dos.writeLong(cdOffset);
origin: de.schlichtherle.truezip/truezip-driver-tzp

    this.dos = out instanceof LEDataOutputStream
      ? (LEDataOutputStream) out
      : new LEDataOutputStream(out);
this.delegate = new TeeOutputStream(dos, new MacOutputStream(mac));
dos.writeInt(SIGNATURE);
dos.writeByte(ENVELOPE_TYPE_0);
dos.writeByte(keyStrengthOrdinal);
dos.writeShort(ITERATION_COUNT);
dos.write(salt);
this.start = dos.size();
assert ENVELOPE_TYPE_0_HEADER_LEN_WO_SALT + salt.length == start;
origin: de.schlichtherle.truezip/truezip-driver-zip

dos.writeInt(CFH_SIG);
dos.writeShort((entry.getRawPlatform() << 8) | 63);
dos.writeShort(entry.getRawVersionNeededToExtract());
dos.writeShort(entry.getGeneralPurposeBitFlags());
dos.writeShort(entry.getRawMethod());
dos.writeInt((int) entry.getRawTime());
dos.writeInt((int) entry.getRawCrc());
dos.writeInt((int) entry.getRawCompressedSize());
dos.writeInt((int) entry.getRawSize());
dos.writeShort(name.length);
dos.writeShort(extra.length);
dos.writeShort(comment.length);
dos.writeShort(0);
dos.writeShort(0);
dos.writeInt((int) entry.getRawExternalAttributes());
origin: de.schlichtherle.truezip/truezip-driver-tzp

  @Override
  protected void finish() throws IOException {
    // Flush partial block to out, if any.
    super.finish();

    final long trailer = dos.size();

    final Mac mac = this.mac;
    assert mac.getMacSize() == klac.getMacSize();
    final byte[] buf = new byte[mac.getMacSize()]; // MAC buffer
    int bufLength;

    // Compute and write the first half of the KLAC to the data envelope footer.
    // Please note that we will only use the first half of the
    // authentication code for security reasons.
    final long length = trailer - start; // message length
    klac(klac, length, buf);
    dos.write(buf, 0, buf.length / 2);

    // Compute and write the first half of the MAC to the data envelope footer.
    // Again, we will only use the first half of the
    // authentication code for security reasons.
    bufLength = mac.doFinal(buf, 0);
    assert bufLength == buf.length;
    dos.write(buf, 0, buf.length / 2);

    assert dos.size() - trailer == buf.length;
  }
}
origin: de.schlichtherle.truezip/truezip-driver-zip

  @Override
  protected void finish() throws IOException {
    // Flush partial block to out, if any.
    super.finish();

    // Compute and write the first half of the MAC to the footer.
    final byte[] buf = mos.getMac();
    dos.write(buf, 0, buf.length / 2);
  }
}
origin: de.schlichtherle.truezip/truezip-driver-zip

/**
 * Returns the total number of (compressed) bytes this stream has written
 * to the underlying stream.
 */
public long length() {
  return this.dos.size();
}
origin: de.schlichtherle.truezip/truezip-driver-zip

@CreatesObligation
@edu.umd.cs.findbugs.annotations.SuppressWarnings("OBL_UNSATISFIED_OBLIGATION")
private static LEDataOutputStream newLEDataOutputStream(
    final @WillCloseWhenClosed OutputStream out,
    final @CheckForNull @WillNotClose RawZipFile<?> appendee) {
  if (null == out)
    throw new NullPointerException();
  return null != appendee
      ? new AppendingLEDataOutputStream(out, appendee)
      : out instanceof LEDataOutputStream
        ? (LEDataOutputStream) out
        : new LEDataOutputStream(out);
}
origin: de.schlichtherle.truezip/truezip-driver-zip

private void writePasswordVerifier(KeyParameter keyParam)
throws IOException {
  dos.write(
      keyParam.getKey(),
      2 * param.getKeyStrength().getBytes(),
      PWD_VERIFIER_BITS / 8);
}
origin: de.schlichtherle.truezip/truezip-driver-zip

closeEntry();
final LEDataOutputStream dos = this.dos;
this.cdOffset = dos.size();
final Iterator<E> i = this.entries.values().iterator();
while (i.hasNext())
origin: de.schlichtherle.truezip/truezip-driver-zip

dos.write(salt);
writePasswordVerifier(keyParam);
de.schlichtherle.truezip.ioLEDataOutputStream

Most used methods

  • <init>
  • size
  • write
  • writeInt
  • writeShort
  • writeByte
  • writeLong

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now