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 );