/** * Reads a Matrix instance from a bit stream. * * @param stream source bit stream * @throws IOException if an I/O error has occured */ public Matrix(InputBitStream stream) throws IOException { hasScale = stream.readBooleanBit(); if (hasScale) { int nScaleBits = (int) stream.readUnsignedBits(5); scaleX = stream.readFPBits(nScaleBits); scaleY = stream.readFPBits(nScaleBits); } hasRotateSkew = stream.readBooleanBit(); if (hasRotateSkew) { int nRotateBits = (int) stream.readUnsignedBits(5); rotateSkew0 = stream.readFPBits(nRotateBits); rotateSkew1 = stream.readFPBits(nRotateBits); } int nTranslateBits = (int) stream.readUnsignedBits(5); translateX = (int) stream.readSignedBits(nTranslateBits); translateY = (int) stream.readSignedBits(nTranslateBits); stream.align(); }