org.jacoco.core.internal

## Class Java9Support

- java.lang.Object
- - org.jacoco.core.internal.Java9Support

    public final class Java9Support
    extends Object

Patching for Java 9 classes, so that ASM can read them.

### Field Summary

Fields
`static int` `V1_9` Version of the Java 9 class file format.

### Method Summary

All Methods Static Methods Concrete Methods
`static byte[]` `downgrade(byte[] b)` Replaces version in the definition of class on `Opcodes.V1_8`.
`static byte[]` `downgradeIfRequired(byte[] buffer)` Returns new definition of class with version `Opcodes.V1_8`, if it has version `V1_9`.
`static boolean` `isPatchRequired(byte[] buffer)` Determines whether class definition contains `V1_9` version.
`static byte[]` `readFully(InputStream is)` Reads all bytes from an input stream into a byte array.
`static void` `upgrade(byte[] b)` Replaces version in the definition of class on `V1_9`.

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

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

### Field Detail

#### V1_9

    public static final int V1_9

Version of the Java 9 class file format.

See Also:
  Constant Field Values

### Method Detail

#### readFully

    public static byte[] readFully(InputStream is)
                            throws IOException

Reads all bytes from an input stream into a byte array.

Parameters:
  `is` - the input stream to read from
Returns:
  a byte array containing all the bytes from the stream
Throws:
  `IOException` - if an I/O error occurs

#### isPatchRequired

    public static boolean isPatchRequired(byte[] buffer)

Determines whether class definition contains `V1_9` version.

Parameters:
  `buffer` - definition of the class
Returns:
  `true` if class definition contains Java 9 version

#### downgradeIfRequired

    public static byte[] downgradeIfRequired(byte[] buffer)

Returns new definition of class with version `Opcodes.V1_8`, if it has version `V1_9`.

Parameters:
  `buffer` - definition of the class
Returns:
  new definition of the class

#### downgrade

    public static byte[] downgrade(byte[] b)

Replaces version in the definition of class on `Opcodes.V1_8`.

Parameters:
  `b` - definition of the class
Returns:
  new definition of the class

#### upgrade

    public static void upgrade(byte[] b)

Replaces version in the definition of class on `V1_9`.

Parameters:
  `b` - definition of the class