docs: @SuppressWarnings({"resource", "checkstyle:magicnumber"})
  	protected void readHeader() throws IOException {
  		final ReadableByteChannel in = Channels.newChannel(this.input);
  		final int limit = HEADER_KEY.getBytes().length + 2;
  		final ByteBuffer hBuffer = ByteBuffer.allocate(limit);
  		hBuffer.limit(limit);
  
  		// Check the header
  		final byte[] key = GISLayerIOConstants.HEADER_KEY.getBytes();
  		final int n = in.read(hBuffer);
  		if (n != limit) {
  			throw new IOException("Invalid file header"); //$NON-NLS-1$
  		}
  		for (int i = 0; i < key.length; ++i) {
  			if (hBuffer.get(i) != key[i]) {
  				throw new IOException("Invalid file header"); //$NON-NLS-1$
  			}
  		}
  		// Check the format version
  		final byte major = hBuffer.get(key.length);
  		final byte minor = hBuffer.get(key.length + 1);
  		if (major != GISLayerIOConstants.MAJOR_SPEC_NUMBER || minor != GISLayerIOConstants.MINOR_SPEC_NUMBER) {
  			throw new IOException("Invalid file format version."); //$NON-NLS-1$
  		}
  		// Read the number of objects inside the input stream
  		final ByteBuffer sBuffer = ByteBuffer.allocate(4);
  		sBuffer.limit(4);
  		in.read(sBuffer);
  		sBuffer.rewind();
  		this.restToRead = sBuffer.getInt();
  	}