Ejemplo n.º 1
0
 void setData(byte[] data) throws IOException {
   InputBitStream inStream = new InputBitStream(data);
   inStream.readUnsignedBits(4); // 4 reserved bits
   playbackRate = (byte) inStream.readUnsignedBits(2);
   isPlayback16BitSample = inStream.readBooleanBit();
   isPlaybackStereo = inStream.readBooleanBit();
   streamFormat = (byte) inStream.readUnsignedBits(4);
   streamRate = (byte) inStream.readUnsignedBits(2);
   isStream16BitSample = inStream.readBooleanBit();
   isStreamStereo = inStream.readBooleanBit();
   streamSampleCount = inStream.readUI16();
   if ((streamFormat == FORMAT_MP3) && (data.length > 4)) {
     latencySeek = inStream.readSI16();
   }
 }
Ejemplo n.º 2
0
 /**
  * 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();
 }
Ejemplo n.º 3
0
 /**
  * Reads a ButtonCondAction instance from a bit stream.
  *
  * @param stream the input bit stream
  * @throws IOException if an I/O error has occured
  */
 public ButtonCondAction(InputBitStream stream) throws IOException {
   idleToOverDown = stream.readBooleanBit();
   outDownToIdle = stream.readBooleanBit();
   outDownToOverDown = stream.readBooleanBit();
   overDownToOutDown = stream.readBooleanBit();
   overDownToOverUp = stream.readBooleanBit();
   overUpToOverDown = stream.readBooleanBit();
   overUpToIdle = stream.readBooleanBit();
   idleToOverUp = stream.readBooleanBit();
   keyPress = (byte) stream.readUnsignedBits(7);
   overDownToIdle = stream.readBooleanBit();
   //    actions             = new ActionBlock(stream);
   actions = ActionBlock.getInstance();
   actions.read(stream);
 }