@Test public void testGetInputStreamReturnsSameStream() throws Exception { AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createNewBytesMessageFacade(); InputStream is1 = amqpBytesMessageFacade.getInputStream(); InputStream is2 = amqpBytesMessageFacade.getInputStream(); assertSame("Got different input streams", is1, is2); }
@Override public InputStream getInputStream() throws JMSException { if (bytesOut != null) { throw new IllegalStateException("Body is being written to, cannot perform a read."); } if (bytesIn == null) { Binary body = getBinaryFromBody(); bytesIn = new ByteBufInputStream( Unpooled.wrappedBuffer(body.getArray(), body.getArrayOffset(), body.getLength())); } return bytesIn; }
AmqpJmsBytesMessageFacade extends AmqpJmsMessageFacade implements JmsBytesMessageFacade { @Override public InputStream getInputStream() throws JMSException { if (bytesOut != null) { throw new IllegalStateException("Body is being written to, cannot perform a read."); } if (bytesIn == null) { Binary body = getBinaryFromBody(); bytesIn = new ByteBufInputStream( Unpooled.wrappedBuffer(body.getArray(), body.getArrayOffset(), body.getLength())); } return bytesIn; } }
AmqpJmsBytesMessageFacade extends AmqpJmsMessageFacade implements JmsBytesMessageFacade { @Override public InputStream getInputStream() throws JMSException { if (bytesOut != null) { throw new IllegalStateException("Body is being written to, cannot perform a read."); } if (bytesIn == null) { Binary body = getBinaryFromBody(); bytesIn = new ByteBufInputStream( Unpooled.wrappedBuffer(body.getArray(), body.getArrayOffset(), body.getLength())); } return bytesIn; }  }
AmqpJmsBytesMessageFacade extends AmqpJmsMessageFacade implements JmsBytesMessageFacade { @Override public InputStream getInputStream() throws JMSException { if (bytesOut != null) { throw new IllegalStateException("Body is being written to, cannot perform a read."); } if (bytesIn == null) { Binary body = getBinaryFromBody(); bytesIn = new ByteBufInputStream( Unpooled.wrappedBuffer(body.getArray(), body.getArrayOffset(), body.getLength())); } return bytesIn; }  @Override AmqpJmsBytesMessageFacade copy(); @Override byte getJmsMsgType(); @Override void clearBody(); @Override InputStream getInputStream(); @Override OutputStream getOutputStream(); @Override void reset(); @Override int getBodyLength(); @Override boolean hasBody(); @Override JmsBytesMessage asJmsMessage(); @Override byte[] copyBody(); @Override void onSend(long producerTtl); }
AmqpJmsBytesMessageFacade extends AmqpJmsMessageFacade implements JmsBytesMessageFacade { @Override public InputStream getInputStream() throws JMSException { if (bytesOut != null) { throw new IllegalStateException("Body is being written to, cannot perform a read."); } if (bytesIn == null) { Binary body = getBinaryFromBody(); bytesIn = new ByteBufInputStream( Unpooled.wrappedBuffer(body.getArray(), body.getArrayOffset(), body.getLength())); } return bytesIn; }  @Override AmqpJmsBytesMessageFacade copy(); @Override byte getJmsMsgType(); @Override void clearBody(); @Override InputStream getInputStream(); @Override OutputStream getOutputStream(); @Override void reset(); @Override int getBodyLength(); @Override boolean hasBody(); @Override JmsBytesMessage asJmsMessage(); @Override byte[] copyBody(); @Override void onSend(long producerTtl);  }