Author: bruno Date: Tue Aug 24 07:58:42 2004 New Revision: 36812 Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/ModuleSource.java Log: sync from trunk support for byte arrays Contributed by Ralph Goers (bugzilla 30812)
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/ModuleSource.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/ModuleSource.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/ModuleSource.java Tue Aug 24 07:58:42 2004 @@ -145,6 +145,8 @@ return (InputStream)obj; } else if ( obj instanceof String ) { return new ByteArrayInputStream( ((String)obj).getBytes() ); + } else if (obj instanceof byte[]) { + return new ByteArrayInputStream((byte[]) obj); } else { throw new SourceException( "The object type: " + obj.getClass() + " could not be serialized as a InputStream " + obj );