摘要: public class QuotationEngine { private static QuotationEngine instance;// 对象实例 private QuotationEngine() { } public static QuotationEngine getInstance() { if (null == instance) { synchronized (QuotationEngine.class) { if (null == instance) { ... 阅读全文
posted @ 2013-10-22 09:25 smith789 阅读(138) 评论(0) 推荐(0) 编辑
摘要: public static byte[] convertToByteArray(Object obj) throws IOException { ObjectOutputStream os = null; ByteArrayOutputStream byteStream = new ByteArrayOutputStream(5000); os = new ObjectOutputStream(new BufferedOutputStream(byteStream)); os.flush(); os.writeObject(... 阅读全文
posted @ 2013-10-22 09:00 smith789 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 1、socket是发动机,提供了具体通信的方式。而http是在发动机基础上封装的轿车。2、socket一旦建立连接,可互通往来。而http通信必须先request再response。3、socket通信内容格式自由。而http协议有严格的协议规范格式。 阅读全文
posted @ 2013-10-22 08:24 smith789 阅读(182) 评论(0) 推荐(0) 编辑