public HandShakeStart receiveHandShakeStart () throws IOException {
        // HandShake length
        inputBuffer.clear().limit(1);
        while (inputBuffer.remaining() > 0) {
            channel.read(inputBuffer);
        }
        inputBuffer.flip();
        int length = 29 + (inputBuffer.get() & 0xFF);

        // Handshake itself
        inputBuffer.limit(length);
        while (inputBuffer.remaining() > 0) {
            channel.read(inputBuffer);
        }
        inputBuffer.flip();
        return BitTorrentMessageDecoder.decodeHandShakeStartFromBuffer(inputBuffer);
    }