public static OutputStream translate(byte from, byte to, InputStream inputStream, String outputFileName)throws IOException{
		int b;
		OutputStream outputStream;
		
		if(inputStream instanceof ObjectInputStream){
			outputStream = new ByteArrayOutputStream();
		}
		else if(inputStream instanceof SequenceInputStream){
			outputStream = new ByteArrayOutputStream();
		}
		else if(inputStream instanceof ByteArrayInputStream){
			outputStream = new ByteArrayOutputStream();
		}
		else if(inputStream instanceof PipedInputStream){
			outputStream = new PipedOutputStream();
		}
		else if(inputStream instanceof FileInputStream){
			outputStream = new FileOutputStream(outputFileName);
		}
		else{//impossible
			throw new IOException("The designated inputstream is invalid.");
		}
		while((b = inputStream.read()) != -1){
			outputStream.write(b == from ? to : b);
			System.out.println(b == from ? to : b);
		}
		return outputStream;
	}