private void recieveFrame() {
        byte newestByte = this.buffer.get();

        if (newestByte == START_OF_FRAME) { // Beginning of Frame
            this.currentFrame = null;

        } else if (newestByte == END_OF_FRAME) { // End of Frame
            String textFrame = null;
            // currentFrame will be null if END_OF_FRAME was send directly after
            // START_OF_FRAME, thus we will send 'null' as the sent message.
            if (this.currentFrame != null)
                textFrame = new String(this.currentFrame.array(), UTF8_CHARSET);
            this.wsl.onMessage(this, textFrame);

        } else { // Regular frame data, add to current frame buffer
            ByteBuffer frame = ByteBuffer.allocate((this.currentFrame != null ? this.currentFrame.capacity() : 0) + this.buffer.capacity());
            if (this.currentFrame != null) {
                this.currentFrame.rewind();
                frame.put(this.currentFrame);
            }
            frame.put(newestByte);
            this.currentFrame = frame;
        }
    }