Code Search for Developers
 
 
  

GZipFileType.java from Magellan-Client at Krugle


Show GZipFileType.java syntax highlighted

/*
 *  Copyright (C) 2000-2004 Roger Butenuth, Andreas Gampe,
 *                          Stefan Goetz, Sebastian Pappert,
 *                          Klaas Prause, Enno Rehling,
 *                          Sebastian Tusk, Ulrich Kuester,
 *                          Ilja Pavkovic
 *
 * This file is part of the Eressea Java Code Base, see the
 * file LICENSING for the licensing information applying to
 * this file.
 *
 */

package com.eressea.io.file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

/**
 * A <code>GZipFileType</code> represents a file compressed with gzip.
 *
 * @author $author$
 * @version $Revision: 305 $
 */
public class GZipFileType extends FileType {
	GZipFileType(File aFile, boolean readonly) throws IOException {
		super(aFile, readonly);
	}

	protected InputStream createInputStream() throws IOException {
		return new GZIPInputStream(new FileInputStream(filename));
	}

	protected OutputStream createOutputStream() throws IOException {
		return new GZIPOutputStream(new FileOutputStream(filename));
	}
    
    /**
     * @see FileType#getInnerName()
     */
    public String getInnerName() {
        return getName().substring(0,getName().indexOf(FileType.GZIP));
    }
}




See more files for this project here

Magellan-Client

The Magellan Client is basicly a GUI for the pbem game eressea but can be used for other pbems based on \"atlantis\" too.

Project homepage: http://sourceforge.net/projects/magellan-client
Programming language(s): Java
License: other

  BZip2FileType.java
  CopyFile.java
  FileBackup.java
  FileType.java
  FileTypeFactory.java
  GZipFileType.java
  InputStreamSourceFileType.java
  UnknownFileType.java
  ZipFileType.java