public int read() throws IOException {
  int temp;
  byte tempbyte;
  if (frameSize == 1) {
    if (conversionType == PCM_SWITCH_SIGNED_8BIT) {
      temp=super.read();
      if (temp < 0)       return temp;
      tempbyte=(byte)(temp & 0xf);
      tempbyte=(tempbyte >= 0) ? (byte)(0x80 | tempbyte) : (byte)(0x7F & tempbyte);
      temp=(int)tempbyte & 0xf;
      return temp;
    }
 else {
      throw new IOException("cannot read a single byte if frame size > 1");
    }
  }
 else {
    throw new IOException("cannot read a single byte if frame size > 1");
  }
}

public int read ( ) throws IOException { int temp ; byte tempbyte ; if ( frameSize == 1 ) { if ( conversionType == PCM_SWITCH_SIGNED_8BIT ) { temp = super . read ( ) ; if ( temp < 0 ) return temp ; tempbyte = ( byte ) ( temp & 0xf ) ; tempbyte = ( tempbyte >= 0 ) ? ( byte ) ( 0x80 | tempbyte ) : ( byte ) ( 0x7F & tempbyte ) ; temp = ( int ) tempbyte & 0xf ; return temp ; } else { throw new IOException ( "cannot read a single byte if frame size > 1" ) ; } } else { throw new IOException ( "cannot read a single byte if frame size > 1" ) ; } }
note that this only works for sign conversions . other conversions require a read of at least 2 bytes .
