@Override public void appendMessage(ByteBuffer payload) throws IOException { if (finished) { throw new IOException("Cannot append to finished buffer"); } if (payload == null) { // empty payload is valid return; } driver.getPolicy().assertValidMessageSize(size + payload.remaining()); size += payload.remaining(); synchronized (utf) { utf.append(payload); } if (needsNotification) { needsNotification = true; this.driver.onReader(this); } }
@Override public void appendMessage(ByteBuffer payload) throws IOException { if (finished) { throw new IOException("Cannot append to finished buffer"); } if (payload == null) { // empty payload is valid return; } driver.getPolicy().assertValidMessageSize(size + payload.remaining()); size += payload.remaining(); synchronized (buf) { // TODO: grow buffer till max binary message size? // TODO: compact this buffer to fit incoming buffer? // TODO: tell connection to suspend if buffer too full? BufferUtil.put(payload,buf); } if (needsNotification) { needsNotification = true; this.driver.onInputStream(this); } }
return new AnnotatedEventDriver(pojoPolicy,websocket,methods);
return new AnnotatedEventDriver(pojoPolicy,websocket,methods);
@Override public void appendMessage(ByteBuffer payload) throws IOException { if (finished) { throw new IOException("Cannot append to finished buffer"); } if (payload == null) { // empty payload is valid return; } driver.getPolicy().assertValidMessageSize(size + payload.remaining()); size += payload.remaining(); synchronized (utf) { utf.append(payload); } if (needsNotification) { needsNotification = true; this.driver.onReader(this); } }
@Override public void appendMessage(ByteBuffer payload) throws IOException { if (finished) { throw new IOException("Cannot append to finished buffer"); } if (payload == null) { // empty payload is valid return; } driver.getPolicy().assertValidMessageSize(size + payload.remaining()); size += payload.remaining(); synchronized (buf) { // TODO: grow buffer till max binary message size? // TODO: compact this buffer to fit incoming buffer? // TODO: tell connection to suspend if buffer too full? BufferUtil.put(payload,buf); } if (needsNotification) { needsNotification = true; this.driver.onInputStream(this); } }