FrameTranscoder
org.http4s.websocket.FrameTranscoder
Attributes
- Source
- FrameTranscoder.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Method that decodes ByteBuffers to objects. None reflects not enough data to decode a message Any unused data in the ByteBuffer will be recycled and available for the next read
Method that decodes ByteBuffers to objects. None reflects not enough data to decode a message Any unused data in the ByteBuffer will be recycled and available for the next read
Value parameters
- in
-
ByteBuffer of immediately available data
Attributes
- Returns
-
optional message if enough data was available
- Source
- FrameTranscoder.scala
def (125).&&(in.length.<=(65535))){ buff.put(in.length.>>>(8).&(255).toByte).put(in.length.&(255).toByte) () }elseif(in.length.>(65535)){ buff.putLong(in.length.toLong) () }else() if(isClient.&&(in.length.>(0))){ valmask:Int=Math.random().*(Integer.MAX_VALUE).toInt valmaskBits:Array[Byte]=Array.apply(mask.>>>(24).&(255).toByte,mask.>>>(16).&(255).toByte,mask.>>>(8).&(255).toByte,mask.>>>(0).&(255).toByte) buff.put(maskBits) valdata:ByteVector=in.data intWrapper(0).until(in.length.toInt).foreach[ByteBuffer](((i:Int)=>buff.put(data.apply(i.toLong).^(maskBits.apply(i.&(3))).toByte))) buff.flip() Array.apply[ByteBuffer](buff)(ClassTag.apply[ByteBuffer](classOf[ByteBuffer])) }else{ buff.flip() Array.apply[ByteBuffer](buff,in.data.toByteBuffer)(ClassTag.apply[ByteBuffer](classOf[ByteBuffer])) } }" t="n"class="documentableName ">frameToBuffer(in: WebSocketFrame): Array[ByteBuffer]
Attributes
- Source
- FrameTranscoder.scala
Concrete fields
Attributes
- Source
- FrameTranscoder.scala
In this article