src/main/java/org/nutz/ssdb4j/SSDBs.java
public static void writeBlock(OutputStream out, byte[] data) throws IOException {
		if (data == null)
			data = EMPTY_ARG;
		out.write(Integer.toString(data.length).getBytes());
		out.write('\n');
		out.write(data);
		out.write('\n');
	}
public static void writeBlock(OutputStream out, byte[] data) throws IOException {
		if (data == null)
			data = EMPTY_ARG;
		out.write(Integer.toString(data.length).getBytes());
		out.write('\n');
		out.write(data);
		out.write('\n');
	}
public static void writeBlock ( OutputStream out , byte [ ] data ) throws IOException { if ( data == null ) data = EMPTY_ARG ; out . write ( Integer . toString ( data . length ) . getBytes ( ) ) ; out . write ( ' ' ) ; out . write ( data ) ; out . write ( ' ' ) ; }
按ssdb的通信协议写入一个Block
<p></p><b>如果本方法抛异常,应立即关闭输出流</b>
@param out 输出流
@param data 需要写入数据块, 如果为null,则转为长度为0的byte[]
@throws IOException 常规IO异常
按ssdb的通信协议写入一个Block <p > < / p > <b > 如果本方法抛异常 应立即关闭输出流< / b >