packetsize = (packetsize + 7) >> 3;
  public synchronized int available()    throws IOException  {    super.available();    int avail = count - pos;    if (encoder.getEncoder().getVbr()) {      switch (mode) {        case 0: // Narrowband          return avail + (in.available() / 320); // count 1 byte for each block available        case 1: // Wideband          return avail + (in.available() / 640); // count 1 byte for each block available        case 2: // Ultra wideband          return avail + (in.available() / 1280); // count 1 byte for each block available        default:          return avail;      }    }    else {      int packetsize;      switch (mode) {        case 0: // Narrowband          packetsize = NbEncoder.NB_FRAME_SIZE[NbEncoder.NB_QUALITY_MAP[encoder.getEncoder().getMode()]];          avail += (in.available() / 320) * packetsize; // 20ms = 160ech = 320bytes          return avail;        case 1: // Wideband          packetsize = SbEncoder.NB_FRAME_SIZE[SbEncoder.NB_QUALITY_MAP[encoder.getEncoder().getMode()]];          packetsize += SbEncoder.SB_FRAME_SIZE[SbEncoder.WB_QUALITY_MAP[encoder.getEncoder().getMode()]];          avail += (in.available() / 640) * packetsize; // 20ms = 320ech = 640bytes          return avail;        case 2: // Ultra wideband          packetsize = SbEncoder.NB_FRAME_SIZE[SbEncoder.NB_QUALITY_MAP[encoder.getEncoder().getMode()]];          packetsize += SbEncoder.SB_FRAME_SIZE[SbEncoder.WB_QUALITY_MAP[encoder.getEncoder().getMode()]];          packetsize += SbEncoder.SB_FRAME_SIZE[SbEncoder.UWB_QUALITY_MAP[encoder.getEncoder().getMode()]];          avail += (in.available() / 1280) * packetsize; // 20ms = 640ech = 1280bytes          return avail;        default:          return avail;      }    }  }