code: private MessageBuffer prepareNumberBuffer(int readLength)
              throws IOException
      {
          int remaining = buffer.size() - position;
          if (remaining >= readLength) {
              // When the data is contained inside the default buffer
              nextReadPosition = position;
              position += readLength;  // here assumes following buffer.getXxx never throws exception
              return buffer; // Return the default buffer
          }
          else {
              // When the default buffer doesn't contain the whole length,
              // fill the temporary buffer from the current data fragment and
              // next fragment(s).
  
              int off = 0;
              if (remaining > 0) {
                  numberBuffer.putMessageBuffer(0, buffer, position, remaining);
                  readLength -= remaining;
                  off += remaining;
              }
  
              while (true) {
                  nextBuffer();
                  int nextSize = buffer.size();
                  if (nextSize >= readLength) {
                      numberBuffer.putMessageBuffer(off, buffer, 0, readLength);
                      position = readLength;
                      break;
                  }
                  else {
                      numberBuffer.putMessageBuffer(off, buffer, 0, nextSize);
                      readLength -= nextSize;
                      off += nextSize;
                  }
              }
  
              nextReadPosition = 0;
              return numberBuffer;
          }
      }
docs: Returns a short size buffer (upto 8 bytes) to read a number value
  
  @param readLength
  @return
  @throws IOException
  @throws MessageInsufficientBufferException If no more buffer can be acquired from the input source for reading the specified data length