易截截图软件、单文件、免安装、纯绿色、仅160KB

Java Programming 【replace tool】

常常需要递归的替换文件内容,如最近我想写了个jEdit插件,jEdit提供了一个插件模板,我只要全部替换一下就成了我自己的工程。在linux下,这好办,shell来搞定,但在Windows下或者不熟悉shell就得想点其他办法来办了,EditPlus可以,UE也可以,不过不太方便的是文件名不好替换,以前给自己写过一个小工具来成批改MP3的名字,后来发现用处蛮大,今天又有新要求了,我就写了MiniTool来完成这一MiniCase。没写UI,因为我自己的系统是RHEL5,喜欢命令行来操作。
Here is the running img by Hypersnap 5.
Here is the code. Just there are two Java files.
package com.jonsenelizee.replace;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Stack;
public class FormattingPrintWriter extends PrintWriter
{
private static final String NEWLINE = System.getProperty("line.separator", "\r\n");
// Standard tab settings
private static final int[] STD_TABS = { 9, 17, 25, 33, 41, 49, 57, 65, 73, 81 };
private boolean _autoFlush;
private int[] _tabs = STD_TABS;
@SuppressWarnings("unchecked")
private Stack _stack = new Stack();
private int _indent;
private int _pos;
/**
* Returns a string consisting of the specified number of spaces.
*
* @return The requested whitespace string.
*/
private static String spaces(int n)
{
char[] ca = new char[n];
for (int i = 0; i < n; i++)
ca[i] = ' ';
return new String(ca, 0, ca.length);
}
/**
* Constructs a new FormattingPrintWriter, without automatic line
* flushing.
*
* @param out
* A character-output stream.
*/
public FormattingPrintWriter(Writer out)
{
super(out);
}
/**
* Constructs a new FormattingPrintWriter.
*
* @param out
* A character-output stream.
* @param autoFlush
* If <code>true</code>, the println() methods will flush
* the output buffer.
*/
public Formattin


相关文档:

java:四则混合运算,模拟微软的计算器

package arrays.myArray;
import java.util.Scanner;
public class SortObject {
 private static int intercePosition = 0; // 记录单个运算数据的长度
 private static int[] intercePositionIndex = null; // 记录“(”的下标
 private static int[] intercePositionEnd = null; // 记录 ......

java:递归:10元钱按1,2,5元任意组合

package game;
public class Money {
 public static void main(String[] args) {
  fun("", 10);
  System.out.println("总共算法:" + i);
 }
 // 10元钱的组成,1,2,5任意组合
 public static int i = 1;
 public static void fun(String log, int n) {
  ......

java:递归汉罗塔游戏最少的走法

package game;
public class HanTaGame {
 public static void main(String[] args) {
  fun('1', '2', '3', 2);
 }
 // 汉塔游戏解决方案
 public static void fun(char src, char idle, char dest, int n) {
  if (1 == n) {
   System.out.println(src ......

调整 Java I/O 性能

这篇文章讨论和阐明了提供 JavaTM I/O 性能的多种技术。大多技术围绕调整磁盘文件 I/O,但是有些内容也同样适合网络 I/O 和窗口输出。第一部分技术讨论底层的I/O问题,然后讨论诸如压缩,格式化和串行化等高级I/O问题。然而这个讨论没有包含应用设计问题,例如搜索算法和数据结构,也没有讨论系统级的问题,例如文件高速缓冲 ......

java中基本输入输出流的解释

网络程序的很大一部分是简单的输入输出,即从一个系统向另一个系统移动字节。字节就是字节,在很大程度上,读服务器发送的数据与读取文件没什么不同;向客户传送数据与写入一个文件也没有什么区别。
Java中输入和输出组织不同于大多数其他语言。它是建立在流(stream)上。不同的基本流类(如java.io.FileInputStream和sun.ne ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号