资源简介
替换路径类似:\opencv_extra\opencv_contrib-3.2.0\modules\dnn.download\bd5e3eed635a8d32e2b99658633815ef\v3.1.0目录下的protobuf-cpp-3.1.0.tar.gz(亲测有效)
代码片段和文件信息
import com.google.protobuf.conformance.Conformance;
import com.google.protobuf.util.JsonFormat;
import com.google.protobuf.util.JsonFormat.TypeRegistry;
import com.google.protobuf.InvalidProtocolBufferException;
class ConformanceJava {
private int testCount = 0;
private TypeRegistry typeRegistry;
private boolean readFromStdin(byte[] buf int len) throws Exception {
int ofs = 0;
while (len > 0) {
int read = System.in.read(buf ofs len);
if (read == -1) {
return false; // EOF
}
ofs += read;
len -= read;
}
return true;
}
private void writeToStdout(byte[] buf) throws Exception {
System.out.write(buf);
}
// Returns -1 on EOF (the actual values will always be positive).
private int readLittleEndianIntFromStdin() throws Exception {
byte[] buf = new byte[4];
if (!readFromStdin(buf 4)) {
return -1;
}
return (buf[0] & 0xff)
| ((buf[1] & 0xff) << 8)
| ((buf[2] & 0xff) << 16)
| ((buf[3] & 0xff) << 24);
}
private void writeLittleEndianIntToStdout(int val) throws Exception {
byte[] buf = new byte[4];
buf[0] = (byte)val;
buf[1] = (byte)(val >> 8);
buf[2] = (byte)(val >> 16);
buf[3] = (byte)(val >> 24);
writeToStdout(buf);
}
private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) {
Conformance.TestAllTypes testMessage;
switch (request.getPayloadCase()) {
case PROTOBUF_PAYLOAD: {
try {
testMessage = Conformance.TestAllTypes.parseFrom(request.getProtobufPayload());
} catch (InvalidProtocolBufferException e) {
return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
}
break;
}
case JSON_PAYLOAD: {
try {
Conformance.TestAllTypes.Builder builder = Conformance.TestAllTypes.newBuilder();
JsonFormat.parser().usingTypeRegistry(typeRegistry)
.merge(request.getJsonPayload() builder);
testMessage = builder.build();
} catch (InvalidProtocolBufferException e) {
return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
}
break;
}
case PAYLOAD_NOT_SET: {
throw new RuntimeException(“Request didn‘t have payload.“);
}
default: {
throw new RuntimeException(“Unexpected payload case.“);
}
}
switch (request.getRequestedOutputFormat()) {
case UNSPECIFIED:
throw new RuntimeException(“Unspecified output format.“);
case PROTOBUF:
return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(testMessage.toByteString()).build();
case JSON:
try {
return Conformance.ConformanceResponse.newBuilder().setJsonPayload(
JsonFormat.printer().usingTypeRegistry(typeRegistry).print(testMessage)).build();
} catch (InvalidProtocolBufferException |
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-06-02 18:59 protobuf-3.1.0\
文件 45860 2016-09-24 10:13 protobuf-3.1.0\aclocal.m4
文件 5826 2016-09-24 10:13 protobuf-3.1.0\ar-lib
文件 1361 2016-09-24 09:16 protobuf-3.1.0\autogen.sh
目录 0 2016-09-24 10:25 protobuf-3.1.0\benchmarks\
文件 4556 2016-09-24 09:16 protobuf-3.1.0\benchmarks\generate_datasets.cc
文件 3009 2016-09-24 09:27 protobuf-3.1.0\benchmarks\Makefile.am
文件 34636 2016-09-24 10:13 protobuf-3.1.0\benchmarks\Makefile.in
文件 28810 2016-09-24 09:27 protobuf-3.1.0\BUILD
文件 65259 2016-09-24 09:37 protobuf-3.1.0\CHANGES.txt
目录 0 2016-09-24 10:25 protobuf-3.1.0\cmake\
文件 6226 2016-09-24 09:16 protobuf-3.1.0\cmake\CMakeLists.txt
文件 2112 2016-09-24 09:16 protobuf-3.1.0\cmake\examples.cmake
文件 14490 2016-09-24 09:27 protobuf-3.1.0\cmake\extract_includes.bat.in
文件 4643 2016-09-24 09:16 protobuf-3.1.0\cmake\install.cmake
文件 2067 2016-09-24 09:16 protobuf-3.1.0\cmake\libprotobuf-lite.cmake
文件 4183 2016-09-24 09:16 protobuf-3.1.0\cmake\libprotobuf.cmake
文件 7913 2016-09-24 09:16 protobuf-3.1.0\cmake\libprotoc.cmake
文件 2805 2016-09-24 09:16 protobuf-3.1.0\cmake\protobuf-config-version.cmake.in
文件 341 2016-09-24 09:16 protobuf-3.1.0\cmake\protobuf-config.cmake.in
文件 7310 2016-09-24 09:16 protobuf-3.1.0\cmake\protobuf-module.cmake.in
文件 281 2016-09-24 09:16 protobuf-3.1.0\cmake\protobuf-options.cmake
文件 173 2016-09-24 09:16 protobuf-3.1.0\cmake\protoc.cmake
文件 12518 2016-09-24 09:16 protobuf-3.1.0\cmake\README.md
文件 10950 2016-09-24 09:27 protobuf-3.1.0\cmake\tests.cmake
文件 7333 2016-09-24 10:13 protobuf-3.1.0\compile
文件 45297 2016-09-24 10:13 protobuf-3.1.0\config.guess
文件 3709 2016-09-24 10:13 protobuf-3.1.0\config.h.in
文件 35564 2016-09-24 10:13 protobuf-3.1.0\config.sub
文件 629588 2016-09-24 10:13 protobuf-3.1.0\configure
文件 6246 2016-09-24 10:12 protobuf-3.1.0\configure.ac
............此处省略987个文件信息
相关资源
- 基于OpenCV的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- opencv环境配置
- win10 64位下编译的opencv4.5.5库,opencv
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- opencv_contrib-3.4.0.zip
- BoW|Pyramid BoW+SVM进行图像分类
- opencv2.4.9源码分析——SIFT
- 用两个摄像头实现,双目标定,双目
- opencv_traincascade训练分类器,手势识别
- opencv3.0交叉编译用parallel.cpp
- 基于opencv的图像识别识别图像中的色
- siftDemoV4.zip
- 基于openCV的识别特定颜色区域
- 基于OpenCV的分水岭算法实现
- QT+opencv+OCR 身份证号码,银行卡号识别
- opencv视频特定颜色区域识别
- 把RGB转换为HSV和HSI然后根据黄色和蓝
- opencv视觉测距
- 基于Qt和opencv的身份证号码识别系统
- opencv_ffmpeg249.dll
- SfM稀疏三维点云重建--完整工程文件
- 基于opencv的数人头程序源代码
- 利用OpenCV中的Stitcher类实现全景图像拼
- 角点检测与匹配
- opencv实现的sift算法源码,包含了图像
- openCV 上的小波变换
- 基于OPENCV的车牌识别系统设计
- 617张国内车牌60-17bmp图片用于OpenCV正样
- hog特征提取,c版本代码
评论
共有 条评论