From: Wolfgang M. M. <wol...@us...> - 2004-06-21 15:27:51
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16641/src/org/exist/xmlrpc Modified Files: RpcServer.java Log Message: Added copyResource method to DBBroker. Index: RpcServer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcServer.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** RpcServer.java 8 Jun 2004 08:16:13 -0000 1.38 --- RpcServer.java 21 Jun 2004 15:27:39 -0000 1.39 *************** *** 1554,1562 **** public static byte[] compress(byte[] whatToCompress, int length) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ! GZIPOutputStream gzos = new GZIPOutputStream(baos); ! // gzos.setMethod(gzos.DEFLATED); ! // gzos.putNextEntry(new ZipEntry(length + "")); gzos.write(whatToCompress, 0, length); ! // gzos.closeEntry(); gzos.finish(); gzos.close(); --- 1554,1562 ---- public static byte[] compress(byte[] whatToCompress, int length) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ! ZipOutputStream gzos = new ZipOutputStream(baos); ! gzos.setMethod(ZipOutputStream.DEFLATED); ! gzos.putNextEntry(new ZipEntry(length + "")); gzos.write(whatToCompress, 0, length); ! gzos.closeEntry(); gzos.finish(); gzos.close(); *************** *** 1567,1573 **** throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(whatToUncompress); ! GZIPInputStream gzis = new GZIPInputStream(bais); ! // ZipEntry zipentry = gzis.getNextEntry(); ! // int len = Integer.parseInt(zipentry.getName()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[512]; --- 1567,1573 ---- throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(whatToUncompress); ! ZipInputStream gzis = new ZipInputStream(bais); ! ZipEntry zipentry = gzis.getNextEntry(); ! int len = Integer.parseInt(zipentry.getName()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[512]; *************** *** 1575,1579 **** while ((bread = gzis.read(buf)) != -1) baos.write(buf, 0, bread); ! // gzis.closeEntry(); gzis.close(); return baos.toByteArray(); --- 1575,1579 ---- while ((bread = gzis.read(buf)) != -1) baos.write(buf, 0, bread); ! gzis.closeEntry(); gzis.close(); return baos.toByteArray(); |