001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.resource.adapter.jms;
023:
024: import javax.jms.BytesMessage;
025: import javax.jms.JMSException;
026:
027: /**
028: * A wrapper for a message
029: *
030: * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
031: * @version $Revision: 57189 $
032: */
033: public class JmsBytesMessage extends JmsMessage implements BytesMessage {
034: /**
035: * Create a new wrapper
036: *
037: * @param message the message
038: * @param session the session
039: */
040: public JmsBytesMessage(BytesMessage message, JmsSession session) {
041: super (message, session);
042: }
043:
044: public long getBodyLength() throws JMSException {
045: return ((BytesMessage) message).getBodyLength();
046: }
047:
048: public boolean readBoolean() throws JMSException {
049: return ((BytesMessage) message).readBoolean();
050: }
051:
052: public byte readByte() throws JMSException {
053: return ((BytesMessage) message).readByte();
054: }
055:
056: public int readBytes(byte[] value, int length) throws JMSException {
057: return ((BytesMessage) message).readBytes(value, length);
058: }
059:
060: public int readBytes(byte[] value) throws JMSException {
061: return ((BytesMessage) message).readBytes(value);
062: }
063:
064: public char readChar() throws JMSException {
065: return ((BytesMessage) message).readChar();
066: }
067:
068: public double readDouble() throws JMSException {
069: return ((BytesMessage) message).readDouble();
070: }
071:
072: public float readFloat() throws JMSException {
073: return ((BytesMessage) message).readFloat();
074: }
075:
076: public int readInt() throws JMSException {
077: return ((BytesMessage) message).readInt();
078: }
079:
080: public long readLong() throws JMSException {
081: return ((BytesMessage) message).readLong();
082: }
083:
084: public short readShort() throws JMSException {
085: return ((BytesMessage) message).readShort();
086: }
087:
088: public int readUnsignedByte() throws JMSException {
089: return ((BytesMessage) message).readUnsignedByte();
090: }
091:
092: public int readUnsignedShort() throws JMSException {
093: return ((BytesMessage) message).readUnsignedShort();
094: }
095:
096: public String readUTF() throws JMSException {
097: return ((BytesMessage) message).readUTF();
098: }
099:
100: public void reset() throws JMSException {
101: ((BytesMessage) message).reset();
102: }
103:
104: public void writeBoolean(boolean value) throws JMSException {
105: ((BytesMessage) message).writeBoolean(value);
106: }
107:
108: public void writeByte(byte value) throws JMSException {
109: ((BytesMessage) message).writeByte(value);
110: }
111:
112: public void writeBytes(byte[] value, int offset, int length)
113: throws JMSException {
114: ((BytesMessage) message).writeBytes(value, offset, length);
115: }
116:
117: public void writeBytes(byte[] value) throws JMSException {
118: ((BytesMessage) message).writeBytes(value);
119: }
120:
121: public void writeChar(char value) throws JMSException {
122: ((BytesMessage) message).writeChar(value);
123: }
124:
125: public void writeDouble(double value) throws JMSException {
126: ((BytesMessage) message).writeDouble(value);
127: }
128:
129: public void writeFloat(float value) throws JMSException {
130: ((BytesMessage) message).writeFloat(value);
131: }
132:
133: public void writeInt(int value) throws JMSException {
134: ((BytesMessage) message).writeInt(value);
135: }
136:
137: public void writeLong(long value) throws JMSException {
138: ((BytesMessage) message).writeLong(value);
139: }
140:
141: public void writeObject(Object value) throws JMSException {
142: ((BytesMessage) message).writeObject(value);
143: }
144:
145: public void writeShort(short value) throws JMSException {
146: ((BytesMessage) message).writeShort(value);
147: }
148:
149: public void writeUTF(String value) throws JMSException {
150: ((BytesMessage) message).writeUTF(value);
151: }
152: }
|