Examples of FrameBuilder


Examples of org.java_websocket.framing.FrameBuilder

    throw new RuntimeException( "not yet implemented" );
  }

  @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 );
  }
View Full Code Here

Examples of org.java_websocket.framing.FrameBuilder

    return buf;
  }

  @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 );
  }
View Full Code Here

Examples of org.java_websocket.framing.FrameBuilder

    return Collections.singletonList( (Framedata) curframe );
  }

  @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 );
  }
View Full Code Here

Examples of org.java_websocket.framing.FrameBuilder

    } else {
      payload.put( buffer.array(), buffer.position(), payload.limit() );
      buffer.position( buffer.position() + payload.limit() );
    }

    FrameBuilder frame;
    if( optcode == Opcode.CLOSING ) {
      frame = new CloseFrameBuilder();
    } else {
      frame = new FramedataImpl1();
      frame.setFin( FIN );
      frame.setOptcode( optcode );
    }
    payload.flip();
    frame.setPayload( payload );
    return frame;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.