private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }
private byte getByte(final long index) { checkForPacket(index); if (fileCache != null && index < packetPosition) { return fileCache.getByteFromCache(index); } else { return currentPacket.getChunk()[(int) (index - packetPosition)]; } }