Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
Collections:
Other Resources:
Apache Ant Source Code Files
Apache Ant Source Code Files are inside the Apache Ant source package file
like apache-ant-1.10.10-src.zip.
Unzip the source package file and go to the "src/main" sub-directory,
you will see source code files.
Here is the list of Java source code files of the Apache Ant 1.10.10 in \Users\fyicenter\apache-ant-1.10.10\src\main:
✍: FYIcenter.com
⏎ org/apache/tools/ant/util/UUEncoder.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
*
* https://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.tools.ant.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
/**
* UUEncoding of an input stream placed into an OutputStream.
* This class is meant to be a drop in replacement for
* sun.misc.UUEncoder, which was previously used by Ant.
* The uuencode algorithm code has been copied from the
* geronimo project.
**/
public class UUEncoder {
protected static final int DEFAULT_MODE = 644;
private static final int MAX_CHARS_PER_LINE = 45;
private static final int INPUT_BUFFER_SIZE = MAX_CHARS_PER_LINE * 100;
private OutputStream out;
private String name;
/**
* Constructor specifying a name for the encoded buffer, begin
* line will be:
* <pre>
* begin 644 [NAME]
* </pre>
* @param name the name of the encoded buffer.
*/
public UUEncoder(String name) {
this.name = name;
}
/**
* UUEncode bytes from the input stream, and write them as text characters
* to the output stream. This method will run until it exhausts the
* input stream.
* @param is the input stream.
* @param out the output stream.
* @throws IOException if there is an error.
*/
public void encode(InputStream is, OutputStream out)
throws IOException {
this.out = out;
encodeBegin();
byte[] buffer = new byte[INPUT_BUFFER_SIZE];
int count;
while ((count = is.read(buffer, 0, buffer.length)) != -1) {
int pos = 0;
while (count > 0) {
int num = count > MAX_CHARS_PER_LINE
? MAX_CHARS_PER_LINE
: count;
encodeLine(buffer, pos, num, out);
pos += num;
count -= num;
}
}
out.flush();
encodeEnd();
}
/**
* Encode a string to the output.
*/
private void encodeString(String n) {
PrintStream writer = new PrintStream(out);
writer.print(n);
writer.flush();
}
private void encodeBegin() {
encodeString("begin " + DEFAULT_MODE + " " + name + "\n");
}
private void encodeEnd() {
encodeString(" \nend\n");
}
/**
* Encode a single line of data (less than or equal to 45 characters).
*
* @param data The array of byte data.
* @param offset The starting offset within the data.
* @param length Length of the data to encode.
* @param out The output stream the encoded data is written to.
* @exception IOException if something goes wrong
*/
private void encodeLine(
byte[] data, int offset, int length, OutputStream out)
throws IOException {
// write out the number of characters encoded in this line.
// CheckStyle:MagicNumber OFF
out.write((byte) ((length & 0x3F) + ' '));
// CheckStyle:MagicNumber ON
byte a;
byte b;
byte c;
for (int i = 0; i < length;) {
// set the padding defaults
b = 1;
c = 1;
// get the next 3 bytes (if we have them)
a = data[offset + i++];
if (i < length) {
b = data[offset + i++];
if (i < length) {
c = data[offset + i++];
}
}
// CheckStyle:MagicNumber OFF
byte d1 = (byte) (((a >>> 2) & 0x3F) + ' ');
byte d2 = (byte) ((((a << 4) & 0x30) | ((b >>> 4) & 0x0F)) + ' ');
byte d3 = (byte) ((((b << 2) & 0x3C) | ((c >>> 6) & 0x3)) + ' ');
byte d4 = (byte) ((c & 0x3F) + ' ');
// CheckStyle:MagicNumber ON
out.write(d1);
out.write(d2);
out.write(d3);
out.write(d4);
}
// terminate with a linefeed alone
out.write('\n');
}
}
⏎ org/apache/tools/ant/util/UUEncoder.java
Or download all of them as a single archive file:
File name: apache-ant-1.10.10-fyi.zip File size: 2392938 bytes Release date: 2021-04-17 Download
⇐ Download Apache Ant Source Package
2021-07-10, ≈396🔥, 0💬
Popular Posts:
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
Where to get the Java source code for Connector/J 8.0 Core API module? Java source code files for Co...
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper ut...
JDK 11 jdk.crypto.mscapi.jmod is the JMOD file for JDK 11 Crypto MSCAPI module. JDK 11 Crypto MSCAPI...
What Is js.jar in Rhino JavaScript 1.7R5? js.jar in Rhino JavaScript 1.7R5 is the JAR file for Rhino...