Class NewAttributeBands


  • public class NewAttributeBands
    extends BandSet
    Sets of bands relating to a non-predefined attribute that has had a layout definition given to pack200 (e.g. via one of the -C, -M, -F or -D command line options)
    • Method Detail

      • addAttribute

        public void addAttribute​(NewAttribute attribute)
      • getAttributeName

        public java.lang.String getAttributeName()
      • getCodec

        private BHSDCodec getCodec​(java.lang.String layoutElement)
        Returns the BHSDCodec that should be used for the given layout element
        Parameters:
        layoutElement -
      • getFlagIndex

        public int getFlagIndex()
      • getStreamUpToMatchingBracket

        private java.io.StringReader getStreamUpToMatchingBracket​(java.io.StringReader reader)
                                                           throws java.io.IOException
        Utility method to get the contents of the given stream, up to the next ], (ignoring pairs of brackets [ and ])
        Parameters:
        reader -
        Returns:
        Throws:
        java.io.IOException - If an I/O error occurs.
      • isUsedAtLeastOnce

        public boolean isUsedAtLeastOnce()
      • numBackwardsCalls

        public int[] numBackwardsCalls()
      • pack

        public void pack​(java.io.OutputStream outputStream)
                  throws java.io.IOException,
                         Pack200Exception
        Description copied from class: BandSet
        Write the packed set of bands to the given output stream
        Specified by:
        pack in class BandSet
        Parameters:
        outputStream - TODO
        Throws:
        java.io.IOException - If an I/O error occurs.
        Pack200Exception - TODO
      • parseLayout

        private void parseLayout()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readBody

        private java.util.List<NewAttributeBands.LayoutElement> readBody​(java.io.StringReader reader)
                                                                  throws java.io.IOException
        Read a 'body' section of the layout from the given stream
        Parameters:
        reader -
        Returns:
        List of LayoutElements
        Throws:
        java.io.IOException - If an I/O error occurs.
      • readInteger

        private int readInteger​(int i,
                                java.io.InputStream inputStream)
      • readNextLayoutElement

        private NewAttributeBands.LayoutElement readNextLayoutElement​(java.io.StringReader reader)
                                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • readNextUnionCase

        private NewAttributeBands.UnionCase readNextUnionCase​(java.io.StringReader reader)
                                                       throws java.io.IOException
        Read a UnionCase from the stream
        Parameters:
        reader -
        Returns:
        Throws:
        java.io.IOException - If an I/O error occurs.
      • readNumber

        private java.lang.Integer readNumber​(java.io.StringReader stream)
                                      throws java.io.IOException
        Read a number from the stream and return it
        Parameters:
        stream -
        Returns:
        Throws:
        java.io.IOException - If an I/O error occurs.
      • readUpToMatchingBracket

        private java.lang.String readUpToMatchingBracket​(java.io.StringReader reader)
                                                  throws java.io.IOException
        Utility method to get the contents of the given stream, up to the next ']', (ignoring pairs of brackets '[' and ']')
        Parameters:
        reader -
        Returns:
        Throws:
        java.io.IOException - If an I/O error occurs.
      • renumberBci

        public void renumberBci​(IntList bciRenumbering,
                                java.util.Map<org.objectweb.asm.Label,​java.lang.Integer> labelsToOffsets)
        Renumber any bytecode indexes or offsets as described in section 5.5.2 of the pack200 specification
        Parameters:
        bciRenumbering - TODO
        labelsToOffsets - TODO
      • resolveCalls

        private void resolveCalls()
        Resolve calls in the attribute layout and returns the number of backwards callables