Class RMFlashBuffer

All Implemented Interfaces:
RMArchiver.Archiving, Serializable, Cloneable

public class RMFlashBuffer extends RMData
This class is like a StringBuffer, except its for writing binary bit data instead of strings, including signed and unsigned bit values, but, more importantly Flash file format primitives (Tags, Rects, Colors, Matrices, records, etc.).
See Also:
  • Constructor Details

    • RMFlashBuffer

      public RMFlashBuffer()
  • Method Details

    • writeUB

      public void writeUB(int bits, long value)
      Write the given unsigned long value out using exactly the given number of bits.
    • writeSB

      public void writeSB(int bits, long value)
      Write the given signed long value out using exactly the given number of bits.
    • writeUI8

      public void writeUI8(int value)
      Writes the given int value as an unsigned 8 bit value.
    • writeUI16

      public void writeUI16(int val)
      Writes the given int value as an unsigned 16 bit value.
    • writeUI32

      public void writeUI32(long val)
      Writes the given long value as an unsigned 32 bit value.
    • writeSI16

      public void writeSI16(int val)
      Writes the given int value as a signed 16 bit value.
    • writeUB1

      public void writeUB1(int val)
      Writes the given int value as an unsigned 1 bit value.
    • writeUB2

      public void writeUB2(int val)
      Writes the given int value as an unsigned 2 bit value.
    • writeUB3

      public void writeUB3(int val)
      Writes the given int value as an unsigned 3 bit value.
    • writeUB4

      public void writeUB4(int val)
      Writes the given int value as an unsigned 4 bit value.
    • writeUB5

      public void writeUB5(int val)
      Writes the given int value as an unsigned 5 bit value.
    • writeUB7

      public void writeUB7(int val)
      Writes the given int value as an unsigned 7 bit value.
    • writeUB8

      public void writeUB8(int val)
      Writes the given int value as an unsigned 8 bit value.
    • writeSB9

      public void writeSB9(int val)
      Writes the given int value as a signed 9 bit value.
    • writeSB16

      public void writeSB16(int val)
      Writes the given int value as a signed 16 bit value.
    • writeRect

      public void writeRect(RMRect aRect)
      Writes the given rect (Nbits UB5, Xmin, Xmax, Ymin, Ymax).
    • writeMatrix

      public void writeMatrix(float a, float b, float c, float d, float tx, float ty)
      Write the given transform components.
    • writeColor

      public void writeColor(RMColor aColor)
      Writes flash for a color.
    • writeColorWithAlpha

      public void writeColorWithAlpha(RMColor aColor)
      Writes flash for a color with alpha.
    • writeColorTransform

      public void writeColorTransform(RMColor c1, RMColor c2, float anOpacity)
      Writes a flash color transform from color 1 to color 2 with given opacity.
    • writeFillStyle

      public void writeFillStyle(RMColor aColor)
      Writes the given color as a solid fill style.
    • writeLineStyle

      public void writeLineStyle(RMColor aColor, float lineWidth)
      Writes the given color and line with as a line style.
    • bitsNeededForUInt

      public int bitsNeededForUInt(long aValue)
      Returns the minimun number of bits required to display given long value.
    • bitsNeededForInt

      public int bitsNeededForInt(int aValue)
      Returns the minimun number of bits required to display given int value.
    • bitsNeededForRect

      public int bitsNeededForRect(RMRect aRect)
      Returns the minimun number of bits required to display given rect.
    • padToByteBoundary

      public void padToByteBoundary()
      Marks the remaining bits in the last byte to used.