org.apache.commons.compress.harmony.unpack200

## Class BandSet

- java.lang.Object
- - org.apache.commons.compress.harmony.unpack200.BandSet

- Direct Known Subclasses:
    AttrDefinitionBands, BcBands, ClassBands, CpBands, FileBands, IcBands, NewAttributeBands

      public abstract class BandSet
      extends Object

  Abstract superclass for a set of bands

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SegmentHeader` | `header`
    `protected Segment` | `segment`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BandSet(Segment segment)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `decodeBandInt(String name, InputStream in, BHSDCodec codec, int count)` Decode a band and return an array of `int` values
    `int[][]` | `decodeBandInt(String name, InputStream in, BHSDCodec defaultCodec, int[] counts)` Decode a band and return an array of `int[]` values
    `protected String[][]` | `getReferences(int[][] ints, String[] reference)`
    `protected String[]` | `getReferences(int[] ints, String[] reference)`
    `CPClass[]` | `parseCPClassReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPNameAndType[]` | `parseCPDescriptorReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPDouble[]` | `parseCPDoubleReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPFieldRef[]` | `parseCPFieldRefReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPFloat[]` | `parseCPFloatReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPInterfaceMethodRef[]` | `parseCPInterfaceMethodRefReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPInteger[]` | `parseCPIntReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPLong[]` | `parseCPLongReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPMethodRef[]` | `parseCPMethodRefReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPUTF8[]` | `parseCPSignatureReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `protected CPUTF8[][]` | `parseCPSignatureReferences(String name, InputStream in, BHSDCodec codec, int[] counts)`
    `CPString[]` | `parseCPStringReferences(String name, InputStream in, BHSDCodec codec, int count)`
    `CPUTF8[]` | `parseCPUTF8References(String name, InputStream in, BHSDCodec codec, int count)`
    `CPUTF8[][]` | `parseCPUTF8References(String name, InputStream in, BHSDCodec codec, int[] counts)`
    `long[][]` | `parseFlags(String name, InputStream in, int[] counts, BHSDCodec hiCodec, BHSDCodec loCodec)`
    `long[][]` | `parseFlags(String name, InputStream in, int[] counts, BHSDCodec codec, boolean hasHi)`
    `long[]` | `parseFlags(String name, InputStream in, int count, BHSDCodec hiCodec, BHSDCodec loCodec)`
    `long[]` | `parseFlags(String name, InputStream in, int count, BHSDCodec codec, boolean hasHi)`
    `String[][]` | `parseReferences(String name, InputStream in, BHSDCodec codec, int[] counts, String[] reference)` Parses count references from `in`, using `codec` to decode the values as indexes into `reference` (which is populated prior to this call).
    `String[]` | `parseReferences(String name, InputStream in, BHSDCodec codec, int count, String[] reference)` Parses count references from `in`, using `codec` to decode the values as indexes into `reference` (which is populated prior to this call).
    `abstract void` | `read(InputStream inputStream)`
    `abstract void` | `unpack()`
    `void` | `unpack(InputStream in)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### segment

          protected Segment segment

    - #### header

          protected SegmentHeader header

  - ### Constructor Detail

    - #### BandSet

          public BandSet(Segment segment)

  - ### Method Detail

    - #### read

          public abstract void read(InputStream inputStream)
                             throws IOException,
                                    Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### unpack

          public abstract void unpack()
                               throws IOException,
                                      Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### unpack

          public void unpack(InputStream in)
                      throws IOException,
                             Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### decodeBandInt

          public int[] decodeBandInt(String name,
                                     InputStream in,
                                     BHSDCodec codec,
                                     int count)
                              throws IOException,
                                     Pack200Exception

      Decode a band and return an array of `int` values
      Parameters:
        `name` - the name of the band (primarily for logging/debugging purposes)
        `in` - the InputStream to decode from
        `codec` - the default Codec for this band
        `count` - the number of elements to read
      Returns:
        an array of decoded `int` values
      Throws:
        `IOException` - if there is a problem reading from the underlying input stream
        `Pack200Exception` - if there is a problem decoding the value or that the value is invalid

    - #### decodeBandInt

          public int[][] decodeBandInt(String name,
                                       InputStream in,
                                       BHSDCodec defaultCodec,
                                       int[] counts)
                                throws IOException,
                                       Pack200Exception

      Decode a band and return an array of `int[]` values
      Parameters:
        `name` - the name of the band (primarily for logging/debugging purposes)
        `in` - the InputStream to decode from
        `defaultCodec` - the default codec for this band
        `counts` - the numbers of elements to read for each int array within the array to be returned
      Returns:
        an array of decoded `int[]` values
      Throws:
        `IOException` - if there is a problem reading from the underlying input stream
        `Pack200Exception` - if there is a problem decoding the value or that the value is invalid

    - #### parseFlags

          public long[] parseFlags(String name,
                                   InputStream in,
                                   int count,
                                   BHSDCodec codec,
                                   boolean hasHi)
                            throws IOException,
                                   Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseFlags

          public long[][] parseFlags(String name,
                                     InputStream in,
                                     int[] counts,
                                     BHSDCodec codec,
                                     boolean hasHi)
                              throws IOException,
                                     Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseFlags

          public long[] parseFlags(String name,
                                   InputStream in,
                                   int count,
                                   BHSDCodec hiCodec,
                                   BHSDCodec loCodec)
                            throws IOException,
                                   Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseFlags

          public long[][] parseFlags(String name,
                                     InputStream in,
                                     int[] counts,
                                     BHSDCodec hiCodec,
                                     BHSDCodec loCodec)
                              throws IOException,
                                     Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseReferences

          public String[] parseReferences(String name,
                                          InputStream in,
                                          BHSDCodec codec,
                                          int count,
                                          String[] reference)
                                   throws IOException,
                                          Pack200Exception

      Parses count references from `in`, using `codec` to decode the values as indexes into `reference` (which is populated prior to this call). An exception is thrown if a decoded index falls outside the range [0..reference.length-1].
      Parameters:
        `name` - the band name
        `in` - the input stream to read from
        `codec` - the BHSDCodec to use for decoding
        `count` - the number of references to decode
        `reference` - the array of values to use for the references
      Returns:
        Parsed references.
      Throws:
        `IOException` - if a problem occurs during reading from the underlying stream
        `Pack200Exception` - if a problem occurs with an unexpected value or unsupported Codec

    - #### parseReferences

          public String[][] parseReferences(String name,
                                            InputStream in,
                                            BHSDCodec codec,
                                            int[] counts,
                                            String[] reference)
                                     throws IOException,
                                            Pack200Exception

      Parses count references from `in`, using `codec` to decode the values as indexes into `reference` (which is populated prior to this call). An exception is thrown if a decoded index falls outside the range [0..reference.length-1]. Unlike the other parseReferences, this post-processes the result into an array of results.
      Parameters:
        `name` - TODO
        `in` - the input stream to read from
        `codec` - the BHSDCodec to use for decoding
        `counts` - the numbers of references to decode for each array entry
        `reference` - the array of values to use for the references
      Returns:
        Parsed references.
      Throws:
        `IOException` - if a problem occurs during reading from the underlying stream
        `Pack200Exception` - if a problem occurs with an unexpected value or unsupported Codec

    - #### parseCPIntReferences

          public CPInteger[] parseCPIntReferences(String name,
                                                  InputStream in,
                                                  BHSDCodec codec,
                                                  int count)
                                           throws IOException,
                                                  Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPDoubleReferences

          public CPDouble[] parseCPDoubleReferences(String name,
                                                    InputStream in,
                                                    BHSDCodec codec,
                                                    int count)
                                             throws IOException,
                                                    Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPFloatReferences

          public CPFloat[] parseCPFloatReferences(String name,
                                                  InputStream in,
                                                  BHSDCodec codec,
                                                  int count)
                                           throws IOException,
                                                  Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPLongReferences

          public CPLong[] parseCPLongReferences(String name,
                                                InputStream in,
                                                BHSDCodec codec,
                                                int count)
                                         throws IOException,
                                                Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPUTF8References

          public CPUTF8[] parseCPUTF8References(String name,
                                                InputStream in,
                                                BHSDCodec codec,
                                                int count)
                                         throws IOException,
                                                Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPUTF8References

          public CPUTF8[][] parseCPUTF8References(String name,
                                                  InputStream in,
                                                  BHSDCodec codec,
                                                  int[] counts)
                                           throws IOException,
                                                  Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPStringReferences

          public CPString[] parseCPStringReferences(String name,
                                                    InputStream in,
                                                    BHSDCodec codec,
                                                    int count)
                                             throws IOException,
                                                    Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPInterfaceMethodRefReferences

          public CPInterfaceMethodRef[] parseCPInterfaceMethodRefReferences(String name,
                                                                            InputStream in,
                                                                            BHSDCodec codec,
                                                                            int count)
                                                                     throws IOException,
                                                                            Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPMethodRefReferences

          public CPMethodRef[] parseCPMethodRefReferences(String name,
                                                          InputStream in,
                                                          BHSDCodec codec,
                                                          int count)
                                                   throws IOException,
                                                          Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPFieldRefReferences

          public CPFieldRef[] parseCPFieldRefReferences(String name,
                                                        InputStream in,
                                                        BHSDCodec codec,
                                                        int count)
                                                 throws IOException,
                                                        Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPDescriptorReferences

          public CPNameAndType[] parseCPDescriptorReferences(String name,
                                                             InputStream in,
                                                             BHSDCodec codec,
                                                             int count)
                                                      throws IOException,
                                                             Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPSignatureReferences

          public CPUTF8[] parseCPSignatureReferences(String name,
                                                     InputStream in,
                                                     BHSDCodec codec,
                                                     int count)
                                              throws IOException,
                                                     Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPSignatureReferences

          protected CPUTF8[][] parseCPSignatureReferences(String name,
                                                          InputStream in,
                                                          BHSDCodec codec,
                                                          int[] counts)
                                                   throws IOException,
                                                          Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### parseCPClassReferences

          public CPClass[] parseCPClassReferences(String name,
                                                  InputStream in,
                                                  BHSDCodec codec,
                                                  int count)
                                           throws IOException,
                                                  Pack200Exception

      Throws:
        `IOException`
        `Pack200Exception`

    - #### getReferences

          protected String[] getReferences(int[] ints,
                                           String[] reference)

    - #### getReferences

          protected String[][] getReferences(int[][] ints,
                                             String[] reference)

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