Class CodeStream

java.lang.Object
com.strobel.reflection.emit.CodeStream

public final class CodeStream extends Object
Author:
strobelm
  • Constructor Details

    • CodeStream

      public CodeStream()
      Constructs a new CodeStream with a default initial size.
    • CodeStream

      public CodeStream(int initialSize)
      Constructs a new CodeStream with the given initial size.
      Parameters:
      initialSize - the initial size of the byte stream to be constructed.
  • Method Details

    • reset

      public void reset()
    • reset

      public void reset(int initialSize)
    • getData

      public byte[] getData()
    • getLength

      public int getLength()
    • putByte

      public CodeStream putByte(int b)
      Puts a byte into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      b - a byte.
      Returns:
      this byte stream.
    • putShort

      public CodeStream putShort(int s)
      Puts a short into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      s - a short.
      Returns:
      this byte stream.
    • putInt

      public CodeStream putInt(int i)
      Puts an int into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      i - an int.
      Returns:
      this byte stream.
    • putLong

      public CodeStream putLong(long l)
      Puts a long into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      l - a long.
      Returns:
      this byte stream.
    • putFloat

      public CodeStream putFloat(float f)
      Puts a float into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      f - a float.
      Returns:
      this byte stream.
    • putDouble

      public CodeStream putDouble(double d)
      Puts a double into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      d - a double.
      Returns:
      this byte stream.
    • putUtf8

      public CodeStream putUtf8(String s)
      Puts an UTF8 string into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      s - a String.
      Returns:
      this byte stream.
    • putByteArray

      public CodeStream putByteArray(byte[] b, int offset, int length)
      Puts an array of bytes into this byte stream. The byte stream is automatically enlarged if necessary.
      Parameters:
      b - an array of bytes. May be null to put length null bytes into this byte stream.
      offset - index of the fist byte of b that must be copied.
      length - number of bytes of b that must be copied.
      Returns:
      this byte stream.