private void restoreOldContent() throws JMSException { // For a message that already had a body and was sent we need to restore the content // if the message is used again without having its clearBody method called. if (this.content != null && this.content.length > 0) { try { ByteSequence toRestore = this.content; if (isCompressed()) { toRestore = new ByteSequence(decompress(this.content)); compressed = false; } this.dataOut.write(toRestore.getData(), toRestore.getOffset(), toRestore.getLength()); // Free up the buffer from the old content, will be re-written when // the message is sent again and storeContent() is called. this.content = null; } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { try { ByteSequence data = getContent(); if (data == null) { data = new ByteSequence(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { if (data.length != 0) { is = new ByteArrayInputStream(decompress(data)); } } else { length = data.getLength(); } dataIn = new DataInputStream(is); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void restoreOldContent() throws JMSException { // For a message that already had a body and was sent we need to restore the content // if the message is used again without having its clearBody method called. if (this.content != null && this.content.length > 0) { try { ByteSequence toRestore = this.content; if (isCompressed()) { toRestore = new ByteSequence(decompress(this.content)); compressed = false; } this.dataOut.write(toRestore.getData(), toRestore.getOffset(), toRestore.getLength()); // Free up the buffer from the old content, will be re-written when // the message is sent again and storeContent() is called. this.content = null; } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void restoreOldContent() throws JMSException { // For a message that already had a body and was sent we need to restore the content // if the message is used again without having its clearBody method called. if (this.content != null && this.content.length > 0) { try { ByteSequence toRestore = this.content; if (isCompressed()) { toRestore = new ByteSequence(decompress(this.content)); compressed = false; } this.dataOut.write(toRestore.getData(), toRestore.getOffset(), toRestore.getLength()); // Free up the buffer from the old content, will be re-written when // the message is sent again and storeContent() is called. this.content = null; } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void restoreOldContent() throws JMSException { // For a message that already had a body and was sent we need to restore the content // if the message is used again without having its clearBody method called. if (this.content != null && this.content.length > 0) { try { ByteSequence toRestore = this.content; if (isCompressed()) { toRestore = new ByteSequence(decompress(this.content)); compressed = false; } this.dataOut.write(toRestore.getData(), toRestore.getOffset(), toRestore.getLength()); // Free up the buffer from the old content, will be re-written when // the message is sent again and storeContent() is called. this.content = null; } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { try { ByteSequence data = getContent(); if (data == null) { data = new ByteSequence(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { if (data.length != 0) { is = new ByteArrayInputStream(decompress(data)); } } else { length = data.getLength(); } dataIn = new DataInputStream(is); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { try { ByteSequence data = getContent(); if (data == null) { data = new ByteSequence(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { if (data.length != 0) { is = new ByteArrayInputStream(decompress(data)); } } else { length = data.getLength(); } dataIn = new DataInputStream(is); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { try { ByteSequence data = getContent(); if (data == null) { data = new ByteSequence(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { if (data.length != 0) { is = new ByteArrayInputStream(decompress(data)); } } else { length = data.getLength(); } dataIn = new DataInputStream(is); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } } }