Tabnine Logo
ExtraFields.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
de.schlichtherle.truezip.zip.ExtraFields

Best Java code snippets using de.schlichtherle.truezip.zip.ExtraFields.get (Showing top 5 results out of 315)

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

final @Nullable ExtraField getExtraField(int headerId) {
  final ExtraFields fields = this.fields;
  return fields == null ? null : fields.get(headerId);
}
origin: de.schlichtherle.truezip/truezip-driver-zip

private byte[] getExtraFields(final boolean zip64) {
  ExtraFields fields = this.fields;
  if (zip64) {
    final ExtraField field = composeZip64ExtraField();
    if (null != field) {
      fields = null != fields ? fields.clone() : new ExtraFields();
      fields.add(field);
    }
  } else {
    assert null == fields || null == fields.get(ZIP64_HEADER_ID);
  }
  return null == fields ? EMPTY : fields.getExtra();
}
origin: de.schlichtherle.truezip/truezip-driver-zip

  @Test
  public void testCollection1() {
    assertEquals(0, fields.getExtra().length);
    final ExtraField ef = new DefaultExtraField(ExtraField.ZIP64_HEADER_ID);
    assertNull(fields.get(ExtraField.ZIP64_HEADER_ID));
    assertNull(fields.add(ef));
    byte[] got = fields.getExtra();
    assertEquals(4 + ef.getDataSize(), got.length);
    assertSame(ef, fields.remove(ExtraField.ZIP64_HEADER_ID));
    assertEquals(0, fields.getExtra().length);
  }
}
origin: de.schlichtherle.truezip/truezip-driver-zip

final ExtraField ef = fields.get(ZIP64_HEADER_ID);
if (null == ef) return;
final byte[] data = ef.getDataBlock();
origin: de.schlichtherle.truezip/truezip-driver-zip

@Test
public void testCollection0() {
  fields.readFrom(serialized, 0, serialized.length);
  final ExtraField ef = fields.get(ExtraField.ZIP64_HEADER_ID);
  assertNotNull(ef);
  assertSame(ef, fields.remove(ExtraField.ZIP64_HEADER_ID));
  assertNull(fields.get(ExtraField.ZIP64_HEADER_ID));
  assertNull(fields.add(ef));
  final byte[] got = fields.getExtra();
  assertNotSame(serialized, got);
  assertTrue(Arrays.equals(serialized, got));
}
de.schlichtherle.truezip.zipExtraFieldsget

Javadoc

Returns the Extra Field with the given Header ID or nullif no such Extra Field exists.

Popular methods of ExtraFields

  • <init>
  • add
    Stores the given Extra Field in this collection.
  • getExtra
    Returns a protective copy of the Extra Fields. null is never returned.
  • getExtraLength
    Returns the number of bytes required to hold the Extra Fields.
  • readFrom
    Deserializes this collection of extra fields from the data block starting at the zero based offset o
  • remove
    Removes the Extra Field with the given Header ID.
  • clone
    Returns a shallow clone of this collection.
  • doSomethingWithExtraFields
  • size
    Returns the number of Extra Fields in this collection.
  • writeTo
    Serializes a list of Extra Fields of #getExtraLength bytes to the byte array data at the zero based

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Join (org.hibernate.mapping)
  • Top 12 Jupyter Notebook extensions
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