Hello...
I've looked through the lists and the source code of the EncodeRepresentation
and am having trouble taking my StringRepresentation and returning a ZIP file to
the client. My code looks something like:

StringBuilder builder = new StringBuilder();
builder.append(....);

and it *seems* like i should simply be able to do this:

Representation r = new EncodeRepresentation( Encoding.ZIP,
                        new ObjectRepresentation(new 
StringRepresentation(builder.toString(),
MediaType.TEXT_PLAIN, Language.ENGLISH_US, CharacterSet.UTF_8  )
                                                                                
                                );
                                                                                
        And pass this to the response and expect a zlib compresed version
returned to the client. If I substitute Encoding.GZIP, instead of ZIP, it works
as expected. right now, however, i get the following error:

INFO: Exception intercepted
java.util.zip.ZipException: no current ZIP entry
        at java.util.zip.ZipOutputStream.write(ZipOutputStream.java:255)
        at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
                                                                

can anyone help shed some light on how I can get around this?

Reply via email to