org.apache.commons.compress.archivers.zip

## Interface UnparseableExtraFieldBehavior

- All Known Subinterfaces:
    ExtraFieldParsingBehavior
  All Known Implementing Classes:
    ExtraFieldUtils.UnparseableExtraField, ZipArchiveEntry.ExtraFieldParsingMode

      public interface UnparseableExtraFieldBehavior

  Handles extra field data that doesn't follow the recommended pattern for extra fields with a two-byte key and a two-byte length.
  Since:
    1.19

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ZipExtraField` | `onUnparseableExtraField(byte[] data, int off, int len, boolean local, int claimedLength)` Decides what to do with extra field data that doesn't follow the recommended pattern.

- - ### Method Detail

    - #### onUnparseableExtraField

          ZipExtraField onUnparseableExtraField(byte[] data,
                                                int off,
                                                int len,
                                                boolean local,
                                                int claimedLength)
                                         throws ZipException

      Decides what to do with extra field data that doesn't follow the recommended pattern.
      Parameters:
        `data` - the array of extra field data
        `off` - offset into data where the unparseable data starts
        `len` - the length of unparseable data
        `local` - whether the extra field data stems from the local file header. If this is false then the data is part if the central directory header extra data.
        `claimedLength` - length of the extra field claimed by the third and forth byte if it did follow the recommended pattern
      Returns:
        null if the data should be ignored or an extra field implementation that represents the data
      Throws:
        `ZipException` - if an error occurs or unparseable extra fields must not be accepted

Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.