org.apache.commons.compress.harmony.pack200

## Class Segment

- java.lang.Object
- - org.apache.commons.compress.harmony.pack200.Segment

- All Implemented Interfaces:
    org.objectweb.asm.ClassVisitor

      public class Segment
      extends Object
      implements org.objectweb.asm.ClassVisitor

  A Pack200 archive consists of one or more Segments.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `Segment.ArrayVisitor`
    `static class` | `Segment.PassException` Exception indicating that the class currently being visited contains an unknown attribute, which means that by default the class file needs to be passed through as-is in the file_bands rather than being packed with pack200.
    `class` | `Segment.SegmentAnnotationVisitor` SegmentAnnotationVisitor implements `AnnotationVisitor` to visit Annotations found in a class file.
    `class` | `Segment.SegmentFieldVisitor` SegmentFieldVisitor implements `FieldVisitor` to visit the metadata relating to fields in a class file.
    `class` | `Segment.SegmentMethodVisitor` This class implements MethodVisitor to visit the contents and metadata related to methods in a class file.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Segment()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AttributeDefinitionBands` | `getAttrBands()`
    `ClassBands` | `getClassBands()`
    `CpBands` | `getCpBands()`
    `Pack200ClassReader` | `getCurrentClassReader()`
    `IcBands` | `getIcBands()`
    `SegmentHeader` | `getSegmentHeader()`
    `boolean` | `lastConstantHadWideIndex()`
    `void` | `pack(org.apache.commons.compress.harmony.pack200.Archive.SegmentUnit segmentUnit, OutputStream out, PackingOptions options)` The main method on Segment.
    `void` | `visit(int version, int access, String name, String signature, String superName, String[] interfaces)`
    `org.objectweb.asm.AnnotationVisitor` | `visitAnnotation(String desc, boolean visible)`
    `void` | `visitAttribute(org.objectweb.asm.Attribute attribute)`
    `void` | `visitEnd()`
    `org.objectweb.asm.FieldVisitor` | `visitField(int flags, String name, String desc, String signature, Object value)`
    `void` | `visitInnerClass(String name, String outerName, String innerName, int flags)`
    `org.objectweb.asm.MethodVisitor` | `visitMethod(int flags, String name, String desc, String signature, String[] exceptions)`
    `void` | `visitOuterClass(String owner, String name, String desc)`
    `void` | `visitSource(String source, String debug)`

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

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

- - ### Constructor Detail

    - #### Segment

          public Segment()

  - ### Method Detail

    - #### pack

          public void pack(org.apache.commons.compress.harmony.pack200.Archive.SegmentUnit segmentUnit,
                           OutputStream out,
                           PackingOptions options)
                    throws IOException,
                           Pack200Exception

      The main method on Segment. Reads in all the class files, packs them and then writes the packed segment out to the given OutputStream.
      Parameters:
        `segmentUnit` - TODO
        `out` - the OutputStream to write the packed Segment to
        `options` - packing options
      Throws:
        `IOException` - If an I/O error occurs.
        `Pack200Exception` - TODO

    - #### visit

          public void visit(int version,
                            int access,
                            String name,
                            String signature,
                            String superName,
                            String[] interfaces)

      Specified by:
        `visit` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitSource

          public void visitSource(String source,
                                  String debug)

      Specified by:
        `visitSource` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitOuterClass

          public void visitOuterClass(String owner,
                                      String name,
                                      String desc)

      Specified by:
        `visitOuterClass` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitAnnotation

          public org.objectweb.asm.AnnotationVisitor visitAnnotation(String desc,
                                                                     boolean visible)

      Specified by:
        `visitAnnotation` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitAttribute

          public void visitAttribute(org.objectweb.asm.Attribute attribute)

      Specified by:
        `visitAttribute` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitInnerClass

          public void visitInnerClass(String name,
                                      String outerName,
                                      String innerName,
                                      int flags)

      Specified by:
        `visitInnerClass` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitField

          public org.objectweb.asm.FieldVisitor visitField(int flags,
                                                           String name,
                                                           String desc,
                                                           String signature,
                                                           Object value)

      Specified by:
        `visitField` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitMethod

          public org.objectweb.asm.MethodVisitor visitMethod(int flags,
                                                             String name,
                                                             String desc,
                                                             String signature,
                                                             String[] exceptions)

      Specified by:
        `visitMethod` in interface `org.objectweb.asm.ClassVisitor`

    - #### visitEnd

          public void visitEnd()

      Specified by:
        `visitEnd` in interface `org.objectweb.asm.ClassVisitor`

    - #### getClassBands

          public ClassBands getClassBands()

    - #### lastConstantHadWideIndex

          public boolean lastConstantHadWideIndex()

    - #### getCpBands

          public CpBands getCpBands()

    - #### getSegmentHeader

          public SegmentHeader getSegmentHeader()

    - #### getAttrBands

          public AttributeDefinitionBands getAttrBands()

    - #### getIcBands

          public IcBands getIcBands()

    - #### getCurrentClassReader

          public Pack200ClassReader getCurrentClassReader()

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