@Override public void setNext(Transformation t) { if (next == null) { this.next = t; } else { next.setNext(t); } }
public WsFrameBase(WsSession wsSession, Transformation transformation) { inputBuffer = new byte[Constants.DEFAULT_BUFFER_SIZE]; messageBufferBinary = ByteBuffer.allocate(wsSession.getMaxBinaryMessageBufferSize()); messageBufferText = CharBuffer.allocate(wsSession.getMaxTextMessageBufferSize()); this.wsSession = wsSession; Transformation finalTransformation; if (isMasked()) { finalTransformation = new UnmaskTransformation(); } else { finalTransformation = new NoopTransformation(); } if (transformation == null) { this.transformation = finalTransformation; } else { transformation.setNext(finalTransformation); this.transformation = transformation; } }