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

com.arangodb.shaded.vertx.core.http.impl.ws.WebSocketFrameInternal Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
/*
 * Copyright (c) 2011-2019 Contributors to the Eclipse Foundation
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
 * which is available at https://www.apache.org/licenses/LICENSE-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
 */

package com.arangodb.shaded.vertx.core.http.impl.ws;

import com.arangodb.shaded.netty.buffer.ByteBuf;
import com.arangodb.shaded.vertx.core.http.WebSocketFrame;

/**
 * A Web Socket frame that represents either text or binary data.
 *
 * @author The Netty Project
 * @author Trustin Lee
 * @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
 */
public interface WebSocketFrameInternal extends WebSocketFrame {

  /**
   * Returns the content of this frame as-is, with no UTF-8 decoding.
   */
  ByteBuf getBinaryData();

  /**
   * Sets the type and the content of this frame.
   *
   * @param binaryData the content of the frame.  If (type & 0x80 == 0),
   *                   it must be encoded in UTF-8.
   * @throws IllegalArgumentException if If (type & 0x80 == 0) and the data is not encoded
   *                                  in UTF-8
   */
  void setBinaryData(ByteBuf binaryData);

  /**
   * Set the type of the content of this frame and populate it with the given content
   *
   * @param textData the content of the frame. Must be valid UTF-8
   */
  void setTextData(String textData);

  /**
   * @return the frame binary data length
   */
  int length();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy