001/* 002 * Copyright (C) 2016 Neo Visionaries Inc. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package NeoVisionaries.WebSockets; 017 018 019/** 020 * Payload generator. 021 * 022 * <EMBED CLASS='external-html' DATA-FILE-ID=LICENSE> 023 * 024 * @since 1.20 025 * 026 * @author Takahiko Kawasaki 027 */ 028public interface PayloadGenerator 029{ 030 /** 031 * Generate a payload of a frame. 032 * 033 * <p> 034 * Note that the maximum payload length of control frames 035 * (e.g. ping frames) is 125 in bytes. Therefore, the length 036 * of a byte array returned from this method must not exceed 037 * 125 bytes. 038 * </p> 039 * 040 * @return 041 * A payload of a frame. 042 */ 043 byte[] generate(); 044}