use of org.java_websocket.exceptions.NotSendableException in project quorrabot by GloriousEggroll.
the class Draft_10 method createFrames.
@Override
public List<Framedata> createFrames(String text, boolean mask) {
FrameBuilder curframe = new FramedataImpl1();
try {
curframe.setPayload(ByteBuffer.wrap(Charsetfunctions.utf8Bytes(text)));
} catch (InvalidDataException e) {
throw new NotSendableException(e);
}
curframe.setFin(true);
curframe.setOptcode(Opcode.TEXT);
curframe.setTransferemasked(mask);
return Collections.singletonList((Framedata) curframe);
}
use of org.java_websocket.exceptions.NotSendableException in project quorrabot by GloriousEggroll.
the class Draft_10 method createFrames.
@Override
public List<Framedata> createFrames(ByteBuffer binary, boolean mask) {
FrameBuilder curframe = new FramedataImpl1();
try {
curframe.setPayload(binary);
} catch (InvalidDataException e) {
throw new NotSendableException(e);
}
curframe.setFin(true);
curframe.setOptcode(Opcode.BINARY);
curframe.setTransferemasked(mask);
return Collections.singletonList((Framedata) curframe);
}
use of org.java_websocket.exceptions.NotSendableException in project quorrabot by GloriousEggroll.
the class Draft_75 method createFrames.
@Override
public List<Framedata> createFrames(String text, boolean mask) {
FrameBuilder frame = new FramedataImpl1();
try {
frame.setPayload(ByteBuffer.wrap(Charsetfunctions.utf8Bytes(text)));
} catch (InvalidDataException e) {
throw new NotSendableException(e);
}
frame.setFin(true);
frame.setOptcode(Opcode.TEXT);
frame.setTransferemasked(mask);
return Collections.singletonList((Framedata) frame);
}
Aggregations