Class ClassFormatOutput

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.apache.derby.iapi.services.classfile.ClassFormatOutput
All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable

public final class ClassFormatOutput extends DataOutputStream
A wrapper around DataOutputStream to provide input functions in terms of the types defined on pages 83 of the Java Virtual Machine spec. For this types use these methods of DataOutputStream
  • float - writeFloat
  • long - writeLong
  • double - writeDouble
  • UTF/String - writeUTF
  • U1Array - write(byte[])
  • Constructor Details

    • ClassFormatOutput

      public ClassFormatOutput()
    • ClassFormatOutput

      public ClassFormatOutput(int size)
    • ClassFormatOutput

      public ClassFormatOutput(OutputStream stream)
  • Method Details

    • putU1

      public void putU1(int i) throws IOException
      Throws:
      IOException
    • putU2

      public void putU2(int i) throws IOException
      Throws:
      IOException
    • putU2

      public void putU2(String limit, int i) throws IOException
      Throws:
      IOException
    • putU4

      public void putU4(int i) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream outTo) throws IOException
      Throws:
      IOException
    • getData

      public byte[] getData()
      Get a reference to the data array the class data is being built in. No copy is made.
    • limit

      static void limit(String name, int limit, int value) throws IOException
      Throw an ClassFormatError if a limit of the Java class file format is reached.
      Parameters:
      name - Terse limit description from JVM spec.
      limit - What the limit is.
      value - What the value for the current class is
      Throws:
      IOException - Thrown when limit is exceeded.