⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tabbedwriter.java

📁 kaffe是一个java虚拟机的源代码。里面包含了一些java例程和标准的java包。
💻 JAVA
字号:
/* * Copyright (c) 1996, 1997, 1998, 1999 *      Transvirtual Technologies, Inc.  All rights reserved. * * See the file "license-lesser.terms" for information on usage and  * redistribution of this file. */package kaffe.rmi.rmic;import java.io.FilterWriter;import java.io.Writer;import java.io.IOException;public class TabbedWriter	extends FilterWriter {private static final String defaultTabstring = "    ";private char[] tabstring; private int tabs;public TabbedWriter(Writer o) {	this(o, defaultTabstring);}public TabbedWriter(Writer o, String str) {	super(o);	tabs = 0;	tabstring = str.toCharArray();}public void write(int c) throws IOException {	out.write(c);	if (c == '\n') {		for (int i = 0; i < tabs; i++) {			out.write(tabstring, 0, tabstring.length);		}	}}public void write(char cbuf[], int off, int len) throws IOException {	for (int i = 0; i < len; i++) {		write((int)cbuf[i+off]);	}}public void write(String str, int off, int len) throws IOException {	write(str.toCharArray(), off, len);}public void unindent() throws IOException {	unindent(1);}public void unindent(int nr) throws IOException {	indent(-nr);}public void indent() throws IOException {	indent(1);}public void indent(int nr) throws IOException {	tabs += nr;	if (tabs < 0) {		tabs = 0;	}	write((int)'\n');}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -