Code example for ZipEntry

Methods: getSize

     * Returns the contents of the given zip entry as a byte array. 
     * @throws IOException if a problem occurred reading the zip entry. 
    public static byte[] convertToByteArray(ZipEntry ze, ZipFile zip)
        throws IOException {
        return convertToByteArray(zip.getInputStream(ze), (int) ze.getSize());
    public static String convertToString(Reader reader) throws IOException {
    	return new String(convertToCharArray(reader, Integer.MAX_VALUE));
    public static char[] convertToCharArray(Reader reader, int length) throws IOException {
        StringWriter sb = new StringWriter();     
        write(sb, reader, length, true);
        return sb.toString().toCharArray();