Logo Search packages:      
Sourcecode: libjlayer-java version File versions  Download package

int javazoom::jl::decoder::Bitstream::readBytes ( byte[]  b,
int  offs,
int  len 
) throws BitstreamException [inline, private]

Simlar to readFully, but doesn't throw exception when EOF is reached.

Definition at line 631 of file Bitstream.java.

References javazoom::jl::decoder::BitstreamErrors::STREAM_ERROR.

Referenced by isSyncCurrentPosition(), and syncHeader().

      {
            int totalBytesRead = 0;
            try
            {
                  while (len > 0)
                  {
                        int bytesread = source.read(b, offs, len);
                        if (bytesread == -1)
                        {
                              break;
                        }
                        totalBytesRead += bytesread;
                        offs += bytesread;
                        len -= bytesread;
                  }
            }
            catch (IOException ex)
            {
                  throw newBitstreamException(STREAM_ERROR, ex);
            }
            return totalBytesRead;
      }


Generated by  Doxygen 1.6.0   Back to index