📄 stringtype.java
字号:
/**
* Created at Nov 20, 2008
*/
package com.jdev.net.data.datatype;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import com.jdev.net.data.DataTypeHelper;
import com.jdev.net.data.Linkable;
import com.jdev.net.data.QueueWorker;
/**
* <p>Title: StringType</p>
* <p>Description: </p>
* @author Lawrence
* @version 1.0
*/
public class StringType implements Linkable {
private String content = null;
private int msgType;
private ByteBuffer byteBuffer = null;
/**
* @param msgType
*/
public StringType(int msgType) {
this.msgType = msgType;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
/* (non-Javadoc)
* @see com.jdev.net.data.Linkable#accpet(com.jdev.net.data.QueueWorker)
*/
public void accpet(QueueWorker worker) throws Exception {
worker.run(msgType, this);
}
/* (non-Javadoc)
* @see com.jdev.net.data.Linkable#getOutputStream()
*/
public OutputStream getOutputStream() {
OutputStream outputStream = null;
try {
outputStream = DataTypeHelper.writeString(content);
} catch (Exception ex) {
}
return outputStream;
}
/* (non-Javadoc)
* @see com.jdev.net.data.Linkable#setInputStream(java.io.InputStream)
*/
public void setInputStream(InputStream in) {
try {
this.content = DataTypeHelper.getString(in);
} catch (Exception ex) {
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -