资源简介
本人从luciol官网下载的一套集成一系列电力规约IEC608705、DNP3协议的java源码框架,而用java编写电力规约本身就很少见,能在网上找到这套代码实属不易。这套框架已经满足大部分需求,代码精简、易懂,对象关系设计合理,各种规约分类明确,只有IEC104规约没有完善,不过可以参考IEC101规约源码及设计思路,本人已经做过测试,工具类灵活、可扩展性强,虽然不能直接商用,但确实参考性极强
代码片段和文件信息
/* Copyright (c) 20022003 Stefan Haustein Oberhausen Rhld. Germany
*
* Permission is hereby granted free of charge to any person obtaining a copy
* of this software and associated documentation files (the “Software“) to deal
* in the Software without restriction including without limitation the rights
* to use copy modify merge publish distribute sublicense and/or
* sell copies of the Software and to permit persons to whom the Software is
* furnished to do so subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
* IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING
* FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE. */
package org.kobjects.base64;
import java.io.*;
public class base64 {
static final char[] charTab =
“ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/“
.toCharArray();
public static String encode(byte[] data) {
return encode(data 0 data.length null).toString();
}
/** Encodes the part of the given byte array denoted by start and
len to the base64 format. The encoded data is appended to the
given StringBuffer. If no StringBuffer is given a new one is
created automatically. The StringBuffer is the return value of
this method. */
public static StringBuffer encode(
byte[] data
int start
int len
StringBuffer buf) {
if (buf == null)
buf = new StringBuffer(data.length * 3 / 2);
int end = len - 3;
int i = start;
int n = 0;
while (i <= end) {
int d =
((((int) data[i]) & 0x0ff) << 16)
| ((((int) data[i + 1]) & 0x0ff) << 8)
| (((int) data[i + 2]) & 0x0ff);
buf.append(charTab[(d >> 18) & 63]);
buf.append(charTab[(d >> 12) & 63]);
buf.append(charTab[(d >> 6) & 63]);
buf.append(charTab[d & 63]);
i += 3;
if (n++ >= 14) {
n = 0;
buf.append(“\r\n“);
}
}
if (i == start + len - 2) {
int d =
((((int) data[i]) & 0x0ff) << 16)
| ((((int) data[i + 1]) & 255) << 8);
buf.append(charTab[(d >> 18) & 63]);
buf.append(charTab[(d >> 12) & 63]);
buf.append(charTab[(d >> 6) & 63]);
buf.append(“=“);
}
else if (i == start + len - 1) {
int d = (((int)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 502757 2003-02-08 16:22 Luciol_V0_2_00z_as_Eclipse_Project\Bouncycastle API 1.18 - J2ME\lcrypto-j2me-118\zips\midp_classes.zip
文件 385349 2003-02-08 16:22 Luciol_V0_2_00z_as_Eclipse_Project\Bouncycastle API 1.18 - J2ME\lcrypto-j2me-118\zips\midp_crypto.zip
文件 455 2003-06-07 09:00 Luciol_V0_2_00z_as_Eclipse_Project\Change_Log.txt
文件 241 2003-05-14 16:25 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.classpath
文件 394 2003-05-14 16:25 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.project
文件 88 2013-12-09 14:46 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.settings\org.eclipse.core.resources.prefs
I.A.... 3 2013-12-27 17:45 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\entries
I.A.... 3 2013-12-27 17:45 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\format
I.A.... 5048 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\00\0079df2c925eddf8ad4a33bd2c57ddbbb476bc7b.svn-ba
I.A.... 1288 2013-12-27 17:49 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\01\01e653cbd0193f52aaa8d36146df2bb3f5fc5e14.svn-ba
I.A.... 4597 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\01\01f70c27924829725b8c95930abbde49d90c9833.svn-ba
I.A.... 1115 2013-12-27 17:49 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\03\033319f9e26efe6ba6f84d1f1d3d67547fddb3e5.svn-ba
I.A.... 2025 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\06\06c6f87f298fdc65006572a1d7230d12b7c55c3b.svn-ba
I.A.... 2546 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\08\08ff224262e5dd0a20d9066dce416e3039d9ea21.svn-ba
I.A.... 16595 2013-12-27 17:49 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\0e\0e972be1f0a37e8122403f682b5d5cf945af33fb.svn-ba
I.A.... 1451 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\0f\0ff9a7861fc6b8c0b36db09b0e58dbc83d38d94a.svn-ba
I.A.... 1122 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\17\173c70e8fde5281b529bb4f837c5d309b6788d09.svn-ba
I.A.... 528 2013-12-27 17:49 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\19\19f1f77a158bd61da619a5fb2d428adbadd3f980.svn-ba
I.A.... 338 2013-12-27 17:49 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\1b\1b87bb8c5691d69ffb4883cbefe838a1a5139bad.svn-ba
I.A.... 1689 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\1c\1cc50018399f131bb66e2c13effb6f106444b6a3.svn-ba
I.A.... 2076 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\20\20f08b31f8170adac9233145d21cb5937fbd6cb5.svn-ba
I.A.... 238 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\23\233d471806c4dc20da6c6e512145f909f151efdb.svn-ba
I.A.... 17739 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\25\2553cdeb299f69be3a81bf2e8100c1e8832c87ae.svn-ba
I.A.... 15818 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\25\25902ceec7324f74e004b584be81e9d2d91c85a8.svn-ba
I.A.... 1136 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\2e\2e0d32bf8193087d99f311ffdc2f9df100536c38.svn-ba
I.A.... 5015 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\2f\2fccdc17f65cfefd68ef9beac68e05d98e62b951.svn-ba
I.A.... 2393 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\37\37a6be6856f8477c5a9a9dca2d0c3dada8df03f5.svn-ba
I.A.... 5853 2013-12-27 17:49 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\38\387053b881a1b54210ce1914a410e7fc65397f8d.svn-ba
I.A.... 1184 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\39\39ade5f96ae16a426ae1e4c1470b08a66c538412.svn-ba
I.A.... 2221 2013-12-27 17:48 Luciol_V0_2_00z_as_Eclipse_Project\Enhydra Librairies\.svn\pristine\3b\3bc066cdad236f9aa3d87ba1f366c5494c494947.svn-ba
............此处省略3270个文件信息
- 上一篇:Android高仿订票系统
- 下一篇:基于mvc的jsp开发教材学生信息管理系统源码
相关资源
- mysql数据处理,java用户登录处理
- 法律咨询信息系统(java+jsp+sqlserver)
- Java快速开发平台源码(renren-fast)
- 锐聘学院QST青软JavaWeb十二个打包
- 3.3.6微信支付JAVA版demo
- javaweb网上购物系统源码(附数据库脚
- javaweb校园宿舍系统(附数据库脚本)
- JavaWeb书城项目(附数据库脚本)
- 基于JAVA_JSP电子书系统(源码+数据库
- Java网络编程知识点总结.xmind
- 一站式Java网络编程 BIO-NIO-AIO资料源码
- jsp讲解
- 基于SSH框架的JavaWeb项目—人员信息管
- javaweb实现的邮件收发系统(附数据库
- Java 仿QQ(附客户端以及服务端源码)
- Java TCP IP Socket
- java定时发送邮件(基于quartz)
- Java Swing开发的《星际争霸》游戏
- java+数据库商品交易管理系统(附数据
- 使用java语言编译一个计算器
- java swing工资管理系统(源码+数据库
- JAVALibrary
- 微信企业号回调模式Java版
- 顺丰丰桥接口开发详细教程源码含下
- Java博客概要设计文档
- 药品进销存管理系统(论文范文_JSP
- 奖学金管理系统java+jsp+mysql
- 毕设参考——基于java酒店管理
- Java写的一个简单的字体更改程序
- java8学习教程之lambda表达式的使用方法
评论
共有 条评论