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

📄 steamfeeder.java

📁 esri的ArcGIS Server超级学习模板程序(for java)
💻 JAVA
字号:
package com.esri.solutions.jitk.datasources.streams;

import java.io.IOException;
import java.io.OutputStream;

public class SteamFeeder {
	protected OutputStream _os;
	public SteamFeeder(OutputStream os) {
		_os = os;
	}
	
	public void writeToStream(StringBuffer sb) throws IOException {
		int size = sb.length();
		int beginIndex = 0;
		int endIndex = 0;
		int blockCopySize = 100;
		char[] chars = new char[blockCopySize];
		
		for (beginIndex = 0; endIndex < (size + 1); beginIndex += blockCopySize) {
			endIndex += blockCopySize;
			
			if (endIndex > size) {
				endIndex = size;
			}
			
			sb.getChars(beginIndex, endIndex, chars, 0);
			String str = new String(chars);
			_os.write(str.getBytes());
			_os.flush();
		}		
	}
}

⌨️ 快捷键说明

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