public byte[] readRawBytes(final int size) throws IOException {
  if (size < 0) {
    throw InvalidProtocolBufferNanoException.negativeSize();
  }
  if (bufferPos + size > currentLimit) {
    skipRawBytes(currentLimit - bufferPos);
    throw InvalidProtocolBufferNanoException.truncatedMessage();
  }
  if (size <= bufferSize - bufferPos) {
    final byte[] bytes=new byte[size];
    System.arraycopy(buffer,bufferPos,bytes,0,size);
    bufferPos+=size;
    return bytes;
  }
 else {
    throw InvalidProtocolBufferNanoException.truncatedMessage();
  }
}

public byte [ ] readRawBytes ( final int size ) throws IOException { if ( size < 0 ) { throw InvalidProtocolBufferNanoException . negativeSize ( ) ; } if ( bufferPos + size > currentLimit ) { skipRawBytes ( currentLimit - bufferPos ) ; throw InvalidProtocolBufferNanoException . truncatedMessage ( ) ; } if ( size <= bufferSize - bufferPos ) { final byte [ ] bytes = new byte [ size ] ; System . arraycopy ( buffer , bufferPos , bytes , 0 , size ) ; bufferPos += size ; return bytes ; } else { throw InvalidProtocolBufferNanoException . truncatedMessage ( ) ; } }
read a fixed size of bytes from the input .
