177178179180181182183184185186187
try { while ((len = value.read(buffer)) != -1) { streamMessage.writeBytes(buffer, 0, len); } } catch (IOException e) { throw new JMSException("Failed to read input stream to create a stream message: " + e);
19241925192619271928192919301931193219331934
data[n] = (byte)n; int BLOCKS = 10; for(int n=0;n<BLOCKS;n++) msg.writeBytes(data); msg.writeBoolean(true); msg.writeByte((byte)12); msg.writeChar('a'); msg.writeDouble(1.23456789);
124125126127128129130131132133134
StreamMessage testMessage = _session.createStreamMessage(); byte[] testBytes = convertToBytes(test); testMessage.writeBytes(testBytes); sendAndTest(testMessage, testBytes); } public void testTextMessage() throws JMSException, IOException
130131132133134135136137138139140
128129130131132133134135136137138
12461247124812491250125112521253125412551256
m.writeInt(myInt); m.writeLong(myLong); m.writeFloat(myFloat); m.writeDouble(myDouble); m.writeString(myString); m.writeBytes(myBytes); m.writeBytes(myBytes, 2, 3); m.writeObject(new Boolean(myBool)); m.writeObject(new Byte(myByte)); m.writeObject(new Short(myShort));
12471248124912501251125212531254125512561257
m.writeLong(myLong); m.writeFloat(myFloat); m.writeDouble(myDouble); m.writeString(myString); m.writeBytes(myBytes); m.writeBytes(myBytes, 2, 3); m.writeObject(new Boolean(myBool)); m.writeObject(new Byte(myByte)); m.writeObject(new Short(myShort)); m.writeObject(new Integer(myInt));
15291530153115321533153415351536153715381539
{ } try { m2.writeBytes(myBytes); ProxyAssertSupport.fail(); } catch (javax.jms.MessageNotWriteableException e) { }
7778798081828384858687
StreamMessage sm = (StreamMessage)m; sm.writeBoolean(true); sm.writeByte((byte)3); sm.writeBytes(new byte[] { (byte)4, (byte)5, (byte)6 }); sm.writeChar((char)7); sm.writeDouble(8.0); sm.writeFloat(9.0f); sm.writeInt(10); sm.writeLong(11l);
byte[] content = new byte[4096]; BufferedInputStream bins = new BufferedInputStream(ins); while (bins.read(content) > 0) { message = session.createStreamMessage(); // message.clearBody(); message.writeBytes(content); producer.send(message); } bins.close(); ins.close(); }