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) { ByteSequence data = getContent(); if (data == null) { data = new ByteSequence(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { // keep track of the real length of the content if // we are compressed. try { DataInputStream dis = new DataInputStream(is); length = dis.readInt(); dis.close(); } catch (IOException e) { throw JMSExceptionSupport.create(e); } is = new InflaterInputStream(is); } else { length = data.getLength(); } dataIn = new DataInputStream(is); } }
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); } } }