Skip to content

Commit 3211181

Browse files
author
Steve Powell
committed
Merge in default
2 parents ec4b675 + 90a8186 commit 3211181

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/com/rabbitmq/client/impl/ValueWriter.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ else if(value instanceof List) {
200200
writeOctet('A');
201201
writeArray((List<?>)value);
202202
}
203+
else if(value instanceof Object[]) {
204+
writeOctet('A');
205+
writeArray((Object[])value);
206+
}
203207
else {
204208
throw new IllegalArgumentException
205209
("Invalid value type: " + value.getClass().getName());
@@ -220,6 +224,20 @@ public final void writeArray(List<?> value)
220224
}
221225
}
222226

227+
public final void writeArray(Object[] value)
228+
throws IOException
229+
{
230+
if (value==null) {
231+
out.write(0);
232+
}
233+
else {
234+
out.writeInt(value.length);
235+
for (Object item : value) {
236+
writeFieldValue(item);
237+
}
238+
}
239+
}
240+
223241
/** Public API - encodes an octet from an int. */
224242
public final void writeOctet(int octet)
225243
throws IOException

0 commit comments

Comments
 (0)