All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.playwright.impl.WebSocketFrameImpl Maven / Gradle / Ivy

Go to download

Java library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast. This is the main package that provides Playwright client.

The newest version!
package com.microsoft.playwright.impl;

import com.microsoft.playwright.WebSocketFrame;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

class WebSocketFrameImpl implements WebSocketFrame {
  private byte[] bytes;
  private String text;

  WebSocketFrameImpl(String payload, boolean isBase64) {
    if (isBase64) {
      bytes = Base64.getDecoder().decode(payload);
    } else {
      text = payload;
    }
  }

  @Override
  public byte[] binary() {
    return bytes;
  }

  @Override
  public String text() {
    return text;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy