com.microsoft.playwright.impl.WebSocketFrameImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of playwright Show documentation
Show all versions of playwright Show documentation
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;
}
}