private Flux<TokenBuffer> tokenize(DataBuffer dataBuffer) { byte[] bytes = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(bytes); DataBufferUtils.release(dataBuffer); try { this.inputFeeder.feedInput(bytes, 0, bytes.length); return parseTokenBufferFlux(); } catch (JsonProcessingException ex) { return Flux.error(new DecodingException( "JSON decoding error: " + ex.getOriginalMessage(), ex)); } catch (IOException ex) { return Flux.error(ex); } }
private Flux<TokenBuffer> tokenize(DataBuffer dataBuffer) { byte[] bytes = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(bytes); DataBufferUtils.release(dataBuffer); try { this.inputFeeder.feedInput(bytes, 0, bytes.length); return parseTokenBufferFlux(); } catch (JsonProcessingException ex) { return Flux.error(new DecodingException( "JSON decoding error: " + ex.getOriginalMessage(), ex)); } catch (IOException ex) { return Flux.error(ex); } }
/** * Feed this ByteString to the given non blocking byte array feeder. * * @param feeder the given {@link ByteArrayFeeder} instance. * * @throws IOException if an exception occurred when feeding data to the feeder. * * <p>This method is useful to parse ByteString instances using non blocking asynchronous parsers without * copying the underlying data.</p> */ public void feedToNonBlockingFeeder(ByteArrayFeeder feeder) throws IOException { for (ByteArray byteArray : _byteArrays._byteArrays) { feeder.feedInput(byteArray._bytes, byteArray._offset, byteArray._length); } }
byteFeeder.feedInput(message, 0, message.length); consumed = true;
private Flux<TokenBuffer> tokenize(DataBuffer dataBuffer) { byte[] bytes = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(bytes); DataBufferUtils.release(dataBuffer); try { this.inputFeeder.feedInput(bytes, 0, bytes.length); return parseTokenBufferFlux(); } catch (JsonProcessingException ex) { return Flux.error(new DecodingException( "JSON decoding error: " + ex.getOriginalMessage(), ex)); } catch (IOException ex) { return Flux.error(ex); } }
private Flux<TokenBuffer> tokenize(DataBuffer dataBuffer) { byte[] bytes = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(bytes); DataBufferUtils.release(dataBuffer); try { this.inputFeeder.feedInput(bytes, 0, bytes.length); return parseTokenBufferFlux(); } catch (JsonProcessingException ex) { return Flux.error(new DecodingException( "JSON decoding error: " + ex.getOriginalMessage(), ex)); } catch (IOException ex) { return Flux.error(ex); } }