Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Apache ZooKeeper Jute Source Code
Apache ZooKeeper is an open-source server which enables highly reliable distributed coordination.
Apache ZooKeeper Jute Source Code files are provided in the source package file, apache-zookeeper-3.8.0.tar.gz.
You can download apache-zookeeper-3.8.0.tar.gz as described in the previous tutorial and go to the "zookeeper-jute" sub-folder to view Apache ZooKeeper Jute Source Code files.
You can also browse Apache ZooKeeper Jute Source Code below:
✍: FYIcenter.com
⏎ org/apache/jute/compiler/JBuffer.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jute.compiler; /** * */ public class JBuffer extends JCompType { /** * Creates a new instance of JBuffer. */ public JBuffer() { super("struct buffer", " ::std::string", "byte[]", "byte[]", "Buffer", "byte[]", "byte[]"); } public String genCppGetSet(String fname, int fIdx) { String cgetFunc = " virtual const " + getCppType() + "& get" + fname + "() const {\n"; cgetFunc += " return m" + fname + ";\n"; cgetFunc += " }\n"; String getFunc = " virtual " + getCppType() + "& get" + fname + "() {\n"; getFunc += " bs_.set(" + fIdx + ");return m" + fname + ";\n"; getFunc += " }\n"; return cgetFunc + getFunc; } public String getSignature() { return "B"; } public String genJavaReadWrapper(String fname, String tag, boolean decl) { String ret = ""; if (decl) { ret = " byte[] " + fname + ";\n"; } return ret + " " + fname + "=a_.readBuffer(\"" + tag + "\");\n"; } public String genJavaWriteWrapper(String fname, String tag) { return " a_.writeBuffer(" + fname + ",\"" + tag + "\");\n"; } public String genJavaCompareTo(String fname, String other) { StringBuilder sb = new StringBuilder(); sb.append(" {\n"); sb.append(" byte[] my = " + fname + ";\n"); sb.append(" byte[] ur = " + other + ";\n"); sb.append(" ret = org.apache.jute.Utils.compareBytes(my,0,my.length,ur,0,ur.length);\n"); sb.append(" }\n"); return sb.toString(); } public String genJavaCompareTo(String fname) { return genJavaCompareTo(fname, "peer." + fname); } public String genJavaCompareToWrapper(String fname, String other) { return " " + genJavaCompareTo(fname, other); } public String genJavaEquals(String fname, String peer) { return " ret = java.util.Arrays.equals(" + fname + "," + peer + ");\n"; } public String genJavaHashCode(String fname) { return " ret = java.util.Arrays.hashCode(" + fname + ");\n"; } public String genJavaSlurpBytes(String b, String s, String l) { StringBuilder sb = new StringBuilder(); sb.append(" {\n"); sb.append(" int i = org.apache.jute.Utils.readVInt(" + b + ", " + s + ");\n"); sb.append(" int z = WritableUtils.getVIntSize(i);\n"); sb.append(" " + s + " += z+i; " + l + " -= (z+i);\n"); sb.append(" }\n"); return sb.toString(); } public String genJavaCompareBytes() { StringBuilder sb = new StringBuilder(); sb.append(" {\n"); sb.append(" int i1 = org.apache.jute.Utils.readVInt(b1, s1);\n"); sb.append(" int i2 = org.apache.jute.Utils.readVInt(b2, s2);\n"); sb.append(" int z1 = WritableUtils.getVIntSize(i1);\n"); sb.append(" int z2 = WritableUtils.getVIntSize(i2);\n"); sb.append(" s1+=z1; s2+=z2; l1-=z1; l2-=z2;\n"); sb.append(" int r1 = org.apache.jute.Utils.compareBytes(b1,s1,l1,b2,s2,l2);\n"); sb.append(" if (r1 != 0) { return (r1<0)?-1:0; }\n"); sb.append(" s1+=i1; s2+=i2; l1-=i1; l1-=i2;\n"); sb.append(" }\n"); return sb.toString(); } }
⏎ org/apache/jute/compiler/JBuffer.java
Or download all of them as a single archive file:
File name: zookeeper-jute-3.8.0-fyi.zip File size: 52965 bytes Release date: 2022-02-25 Download
⇒ Apache ZooKeeper IT Source Code
⇐ Apache ZooKeeper Server Source Code
2022-02-04, 5152👍, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
What Is poi-contrib-3.5.jar? poi-contrib-3.5.jar is one of the JAR files for Apache POI 3.5, which p...
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.1? The if you...
JDK 17 jdk.localedata.jmod is the JMOD file for JDK 17 Localedata module. JDK 17 Locale Data module ...