MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / ByteData

Class ByteData

CodenameOne/src/com/codename1/io/grpc/GrpcWeb.java:255–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 /// `ConnectionRequest.setRequestBody(Data)` without an extra
254 /// copy.
255 private static final class ByteData implements Data {
256 private final byte[] body;
257
258 ByteData(byte[] body) {
259 this.body = body;
260 }
261
262 @Override
263 public void appendTo(OutputStream output) throws IOException {
264 output.write(body);
265 }
266
267 @Override
268 public long getSize() throws IOException {
269 return body.length;
270 }
271 }
272
273 /// Subclasses `ConnectionRequest` so we can suppress its default
274 /// "non-2xx is an error" handling -- gRPC-Web always returns

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected