code: public int read(byte[] dest, int length, int bufferOffset, int fileOffset) {
  
          if (fileOffset >= m_buffer.size()) {
              return -1;
          }
          int readEnd = fileOffset + length;
          if (readEnd > m_buffer.size()) {
              length = length - (readEnd - m_buffer.size());
          }
          m_buffer.readBytes(dest, fileOffset, bufferOffset, length);
          return length;
      }
docs: Transfers data from this buffer to a byte array.<p>
  
  @param dest the target byte array
  
  @param length the number of bytes to transfer
  @param bufferOffset the start index for the target buffer
  @param fileOffset the start index for this instance
  
  @return the number of bytes read, or -1 if we are at the end of the file