1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.websocket.common.frames;
20
21 import java.nio.ByteBuffer;
22
23 import org.eclipse.jetty.util.StringUtil;
24 import org.eclipse.jetty.websocket.common.OpCode;
25
26 public class BinaryFrame extends DataFrame
27 {
28 public BinaryFrame()
29 {
30 super(OpCode.BINARY);
31 }
32
33 public BinaryFrame setPayload(ByteBuffer buf)
34 {
35 super.setPayload(buf);
36 return this;
37 }
38
39 public BinaryFrame setPayload(byte[] buf)
40 {
41 setPayload(ByteBuffer.wrap(buf));
42 return this;
43 }
44
45 public BinaryFrame setPayload(String payload)
46 {
47 setPayload(StringUtil.getUtf8Bytes(payload));
48 return this;
49 }
50
51 @Override
52 public Type getType()
53 {
54 return Type.BINARY;
55 }
56 }