Run more formatting fixes in preparation for the open-source change

Similar to [] these are issues found by Google Java Format. Most of the output is just using the standard [] formatter, then fixing any line-length issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232488284
This commit is contained in:
gbrodman 2019-02-05 08:11:46 -08:00 committed by jianglai
parent 058ef07e16
commit 89802329b3
3 changed files with 173 additions and 148 deletions

View file

@ -50,9 +50,7 @@ public class RdapTestHelper {
} }
static ImmutableList<ImmutableMap<String, Object>> createNotices( static ImmutableList<ImmutableMap<String, Object>> createNotices(
String linkBase, String linkBase, ContactNoticeType contactNoticeType, @Nullable Object otherNotices) {
ContactNoticeType contactNoticeType,
@Nullable Object otherNotices) {
ImmutableList.Builder<ImmutableMap<String, Object>> noticesBuilder = ImmutableList.Builder<ImmutableMap<String, Object>> noticesBuilder =
getBuilderWithOthersAdded(otherNotices); getBuilderWithOthersAdded(otherNotices);
switch (contactNoticeType) { switch (contactNoticeType) {
@ -67,12 +65,14 @@ public class RdapTestHelper {
case CONTACT: case CONTACT:
noticesBuilder.add( noticesBuilder.add(
ImmutableMap.of( ImmutableMap.of(
"title", "Data Policy", "title",
"Data Policy",
"description", "description",
ImmutableList.of( ImmutableList.of(
"Some of the data in this object has been removed.", "Some of the data in this object has been removed.",
"Contact personal data is visible only to the owning registrar."), "Contact personal data is visible only to the owning registrar."),
"type", "object truncated due to authorization", "type",
"object truncated due to authorization",
"links", "links",
ImmutableList.of( ImmutableList.of(
ImmutableMap.of( ImmutableMap.of(
@ -215,53 +215,56 @@ public class RdapTestHelper {
static RdapJsonFormatter getTestRdapJsonFormatter() { static RdapJsonFormatter getTestRdapJsonFormatter() {
RdapJsonFormatter rdapJsonFormatter = new RdapJsonFormatter(); RdapJsonFormatter rdapJsonFormatter = new RdapJsonFormatter();
rdapJsonFormatter.rdapTosPath = "/tos"; rdapJsonFormatter.rdapTosPath = "/tos";
rdapJsonFormatter.rdapHelpMap = ImmutableMap.of( rdapJsonFormatter.rdapHelpMap =
"/", ImmutableMap.of(
RdapNoticeDescriptor.builder() "/",
.setTitle("RDAP Help") RdapNoticeDescriptor.builder()
.setDescription(ImmutableList.of( .setTitle("RDAP Help")
"domain/XXXX", .setDescription(
"nameserver/XXXX", ImmutableList.of(
"entity/XXXX", "domain/XXXX",
"domains?name=XXXX", "nameserver/XXXX",
"domains?nsLdhName=XXXX", "entity/XXXX",
"domains?nsIp=XXXX", "domains?name=XXXX",
"nameservers?name=XXXX", "domains?nsLdhName=XXXX",
"nameservers?ip=XXXX", "domains?nsIp=XXXX",
"entities?fn=XXXX", "nameservers?name=XXXX",
"entities?handle=XXXX", "nameservers?ip=XXXX",
"help/XXXX")) "entities?fn=XXXX",
.setLinkValueSuffix("help/") "entities?handle=XXXX",
.setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md") "help/XXXX"))
.build(), .setLinkValueSuffix("help/")
"/tos", .setLinkHrefUrlString("https://github.com/google/nomulus/blob/master/docs/rdap.md")
RdapNoticeDescriptor.builder() .build(),
.setTitle("RDAP Terms of Service") "/tos",
.setDescription(ImmutableList.of( RdapNoticeDescriptor.builder()
"By querying our Domain Database, you are agreeing to comply with these terms so" .setTitle("RDAP Terms of Service")
+ " please read them carefully.", .setDescription(
"Any information provided is 'as is' without any guarantee of accuracy.", ImmutableList.of(
"Please do not misuse the Domain Database. It is intended solely for" "By querying our Domain Database, you are agreeing to comply with these"
+ " query-based access.", + " terms so please read them carefully.",
"Don't use the Domain Database to allow, enable, or otherwise support the" "Any information provided is 'as is' without any guarantee of accuracy.",
+ " transmission of mass unsolicited, commercial advertising or" "Please do not misuse the Domain Database. It is intended solely for"
+ " solicitations.", + " query-based access.",
"Don't access our Domain Database through the use of high volume, automated" "Don't use the Domain Database to allow, enable, or otherwise support the"
+ " electronic processes that send queries or data to the systems of any" + " transmission of mass unsolicited, commercial advertising or"
+ " ICANN-accredited registrar.", + " solicitations.",
"You may only use the information contained in the Domain Database for lawful" "Don't access our Domain Database through the use of high volume, automated"
+ " purposes.", + " electronic processes that send queries or data to the systems of"
"Do not compile, repackage, disseminate, or otherwise use the information" + " any ICANN-accredited registrar.",
+ " contained in the Domain Database in its entirety, or in any substantial" "You may only use the information contained in the Domain Database for"
+ " portion, without our prior written permission.", + " lawful purposes.",
"We may retain certain details about queries to our Domain Database for the" "Do not compile, repackage, disseminate, or otherwise use the information"
+ " purposes of detecting and preventing misuse.", + " contained in the Domain Database in its entirety, or in any"
"We reserve the right to restrict or deny your access to the database if we" + " substantial portion, without our prior written permission.",
+ " suspect that you have failed to comply with these terms.", "We may retain certain details about queries to our Domain Database for the"
"We reserve the right to modify this agreement at any time.")) + " purposes of detecting and preventing misuse.",
.setLinkValueSuffix("help/tos") "We reserve the right to restrict or deny your access to the database if we"
.setLinkHrefUrlString("https://www.registry.tld/about/rdap/tos.html") + " suspect that you have failed to comply with these terms.",
.build()); "We reserve the right to modify this agreement at any time."))
.setLinkValueSuffix("help/tos")
.setLinkHrefUrlString("https://www.registry.tld/about/rdap/tos.html")
.build());
return rdapJsonFormatter; return rdapJsonFormatter;
} }

View file

@ -122,10 +122,11 @@ public class HexDumperTest {
assertThat(out.toString()).isEmpty(); assertThat(out.toString()).isEmpty();
// But one more byte will bring the total to N+1, thereby flushing a line of hexdump output. // But one more byte will bring the total to N+1, thereby flushing a line of hexdump output.
dumper.write(0); dumper.write(0);
assertThat(out.toString()).isEqualTo("" assertThat(out.toString())
+ "00000000 53 77 65 65 74 20 74 6f 20 74 6f 6e 67 75 65 20 61 6e 64 20 73 6f 75 6e 64 " .isEqualTo(
+ "20 74 6f 20 65 79 65 3b 20 43 6f 6d 65 20 62 75 79 2c 20 63 6f 6d 65 20 62 75 79 2e " "00000000 53 77 65 65 74 20 74 6f 20 74 6f 6e 67 75 65 20 61 6e 64 20 73 6f "
+ "00 Sweet to tongue and sound to eye; Come buy, come buy..\n"); + "75 6e 64 20 74 6f 20 65 79 65 3b 20 43 6f 6d 65 20 62 75 79 2c 20 63 6f 6d 65 "
+ "20 62 75 79 2e 00 Sweet to tongue and sound to eye; Come buy, come buy..\n");
// No additional data will need to be written upon close. // No additional data will need to be written upon close.
int oldTotal = out.toString().length(); int oldTotal = out.toString().length();
assertThat(out.toString().length()).isEqualTo(oldTotal); assertThat(out.toString().length()).isEqualTo(oldTotal);

View file

@ -44,42 +44,46 @@ public class PosixTarHeaderTest {
// head -c 1024 <hello.tar | base64 // head -c 1024 <hello.tar | base64
// //
// As you can see, we're only going to bother with the first 1024 characters. // As you can see, we're only going to bother with the first 1024 characters.
byte[] gnuTarGeneratedData = base64().decode("" byte[] gnuTarGeneratedData =
+ "aGVsbG8ueG1sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" base64()
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAwMDA2NDAAMDU0MTI2" .decode(
+ "NgAwMDExNjEwADAwMDAwMDAwMDE0ADEyMjAyMzEwMzI0ADAxMjQ2MQAgMAAAAAAAAAAAAAAAAAAA" ""
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "aGVsbG8ueG1sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1c3RhcgAwMGphcnQAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAwMDA2NDAAMDU0MTI2"
+ "AAAAAAAAAAAAAAAAZW5nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwADAwMDAw" + "NgAwMDExNjEwADAwMDAwMDAwMDE0ADEyMjAyMzEwMzI0ADAxMjQ2MQAgMAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==");
assertThat(gnuTarGeneratedData.length).isEqualTo(1024); assertThat(gnuTarGeneratedData.length).isEqualTo(1024);
// Now we have to replicate it. // Now we have to replicate it.
byte[] data = "hello kitty\n".getBytes(UTF_8); byte[] data = "hello kitty\n".getBytes(UTF_8);
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
.setType(PosixTarHeader.Type.REGULAR) new PosixTarHeader.Builder()
.setName("hello.xml") .setType(PosixTarHeader.Type.REGULAR)
.setSize(data.length) .setName("hello.xml")
.setMode(0640) .setSize(data.length)
// This timestamp should have been midnight but I think GNU tar might not understand .setMode(0640)
// daylight savings time. Woe is me. // This timestamp should have been midnight but I think GNU tar might not understand
.setMtime(DateTime.parse("2013-08-13T01:50:12Z")) // daylight savings time. Woe is me.
.setUname("jart") .setMtime(DateTime.parse("2013-08-13T01:50:12Z"))
.setGname("eng") .setUname("jart")
.setUid(180918) // echo $UID .setGname("eng")
.setGid(5000) // import grp; print grp.getgrnam('eng').gr_gid .setUid(180918) // echo $UID
.build(); .setGid(5000) // import grp; print grp.getgrnam('eng').gr_gid
.build();
ByteArrayOutputStream output = new ByteArrayOutputStream(); ByteArrayOutputStream output = new ByteArrayOutputStream();
output.write(header.getBytes()); output.write(header.getBytes());
output.write(data); output.write(data);
@ -87,7 +91,7 @@ public class PosixTarHeaderTest {
if (data.length % 512 != 0) { if (data.length % 512 != 0) {
output.write(new byte[512 - data.length % 512]); output.write(new byte[512 - data.length % 512]);
} }
output.write(new byte[1024]); // Bunch of null bytes to indicate end of archive. output.write(new byte[1024]); // Bunch of null bytes to indicate end of archive.
byte[] tarData = output.toByteArray(); byte[] tarData = output.toByteArray();
assertThat(tarData.length % 512).isEqualTo(0); assertThat(tarData.length % 512).isEqualTo(0);
data = Arrays.copyOf(tarData, 1024); data = Arrays.copyOf(tarData, 1024);
@ -117,17 +121,18 @@ public class PosixTarHeaderTest {
@Test @Test
public void testFields() { public void testFields() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
.setType(PosixTarHeader.Type.REGULAR) new PosixTarHeader.Builder()
.setName("(◕‿◕).txt") .setType(PosixTarHeader.Type.REGULAR)
.setSize(666) .setName("(◕‿◕).txt")
.setMode(0777) .setSize(666)
.setMtime(DateTime.parse("1984-12-18T04:20:00Z")) .setMode(0777)
.setUname("everything i ever touched") .setMtime(DateTime.parse("1984-12-18T04:20:00Z"))
.setGname("everything i ever had, has died") .setUname("everything i ever touched")
.setUid(180918) .setGname("everything i ever had, has died")
.setGid(5000) .setUid(180918)
.build(); .setGid(5000)
.build();
assertThat(header.getType()).isEqualTo(PosixTarHeader.Type.REGULAR); assertThat(header.getType()).isEqualTo(PosixTarHeader.Type.REGULAR);
assertThat(header.getName()).isEqualTo("(◕‿◕).txt"); assertThat(header.getName()).isEqualTo("(◕‿◕).txt");
assertThat(header.getSize()).isEqualTo(666); assertThat(header.getSize()).isEqualTo(666);
@ -143,17 +148,18 @@ public class PosixTarHeaderTest {
@Test @Test
public void testFieldsSomeMoar() { public void testFieldsSomeMoar() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
.setType(PosixTarHeader.Type.DIRECTORY) new PosixTarHeader.Builder()
.setName("Black lung full of fumes, choke on memories") .setType(PosixTarHeader.Type.DIRECTORY)
.setSize(1024 * 1024 * 1024) .setName("Black lung full of fumes, choke on memories")
.setMode(31337) .setSize(1024 * 1024 * 1024)
.setMtime(DateTime.parse("2020-12-18T04:20:00Z")) .setMode(31337)
.setUname("every street i ever walked") .setMtime(DateTime.parse("2020-12-18T04:20:00Z"))
.setGname("every home i ever had, is lost") .setUname("every street i ever walked")
.setUid(0) .setGname("every home i ever had, is lost")
.setGid(31337) .setUid(0)
.build(); .setGid(31337)
.build();
assertThat(header.getType()).isEqualTo(PosixTarHeader.Type.DIRECTORY); assertThat(header.getType()).isEqualTo(PosixTarHeader.Type.DIRECTORY);
assertThat(header.getName()).isEqualTo("Black lung full of fumes, choke on memories"); assertThat(header.getName()).isEqualTo("Black lung full of fumes, choke on memories");
assertThat(header.getSize()).isEqualTo(1024 * 1024 * 1024); assertThat(header.getSize()).isEqualTo(1024 * 1024 * 1024);
@ -167,18 +173,19 @@ public class PosixTarHeaderTest {
@Test @Test
public void testLoad() { public void testLoad() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
.setType(PosixTarHeader.Type.REGULAR) new PosixTarHeader.Builder()
.setName("(◕‿◕).txt") .setType(PosixTarHeader.Type.REGULAR)
.setSize(31337) .setName("(◕‿◕).txt")
.setMode(0777) .setSize(31337)
.setMtime(DateTime.parse("1984-12-18T04:20:00Z")) .setMode(0777)
.setUname("everything i ever touched") .setMtime(DateTime.parse("1984-12-18T04:20:00Z"))
.setGname("everything i ever had, has died") .setUname("everything i ever touched")
.setUid(180918) .setGname("everything i ever had, has died")
.setGid(5000) .setUid(180918)
.build(); .setGid(5000)
header = PosixTarHeader.from(header.getBytes()); // <-- Pay attention to this line. .build();
header = PosixTarHeader.from(header.getBytes()); // <-- Pay attention to this line.
assertThat(header.getType()).isEqualTo(PosixTarHeader.Type.REGULAR); assertThat(header.getType()).isEqualTo(PosixTarHeader.Type.REGULAR);
assertThat(header.getName()).isEqualTo("(◕‿◕).txt"); assertThat(header.getName()).isEqualTo("(◕‿◕).txt");
assertThat(header.getSize()).isEqualTo(31337); assertThat(header.getSize()).isEqualTo(31337);
@ -194,10 +201,8 @@ public class PosixTarHeaderTest {
@Test @Test
public void testBadChecksum() { public void testBadChecksum() {
PosixTarHeader header = new PosixTarHeader.Builder() PosixTarHeader header =
.setName("(◕‿◕).txt") new PosixTarHeader.Builder().setName("(◕‿◕).txt").setSize(31337).build();
.setSize(31337)
.build();
byte[] bytes = header.getBytes(); byte[] bytes = header.getBytes();
bytes[150] = '0'; bytes[150] = '0';
bytes[151] = '0'; bytes[151] = '0';
@ -230,7 +235,7 @@ public class PosixTarHeaderTest {
.build()) .build())
.addEqualityGroup( .addEqualityGroup(
new PosixTarHeader.Builder() new PosixTarHeader.Builder()
.setName("(•︵•).txt") // Awwwww! It looks so sad... .setName("(•︵•).txt") // Awwwww! It looks so sad...
.setSize(123) .setSize(123)
.build()) .build())
.testEquals(); .testEquals();
@ -245,11 +250,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar --format=ustar -c liketears inrain | gzip | base64 // tar --format=ustar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAIl5DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5hTH" new GZIPInputStream(
+ "4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh9Bu7L8+Sj" new ByteArrayInputStream(
+ "4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NLSr6/w1L/6cmHu79H" base64()
+ "7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); .decode(
"H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5h"
+ "TH4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh"
+ "9Bu7L8+Sj4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NL"
+ "Sr6/w1L/6cmHu79H7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];
@ -299,11 +308,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar -c liketears inrain | gzip | base64 // tar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5hTH" new GZIPInputStream(
+ "4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh9Bu7L8+Sj" new ByteArrayInputStream(
+ "4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NLSr6/w1L/6cmHu79H" base64()
+ "7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA="))); .decode(
"H4sIAM17DVIAA+3T0QqCMBTGca97ivMIx03n84waaNkMNcS3T4OCbuymFcH/dzc22Dd2vrY5h"
+ "TH4fsjSUVWnKllZ5MY5Wde6rvXBVpIbo9ZUpnKFaG7VlZlowkxP12H0/RLl6Ptx69xUh"
+ "9Bu7L8+Sj4bMp3YSe+bKHsfZfJDLX7ys5xnuQ/F7tfxkFgT1+9Pe8f7/ttn/12hS/+NL"
+ "Sr6/w1L/6cmHu79H7purMNa/ssyE3QfAAAAAAAAAAAAAADgH9wAqAJg4gAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];
@ -353,11 +366,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar -c liketears inrain | gzip | base64 // tar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAHV8DVIAA+3TTQ6CMBCG4a49xRxhWqCcp1Ei+FMMYIi3t3RhXOkKjMn77Npp0klmvkt3bqY" new GZIPInputStream(
+ "mDKNZjyZe1WhVWud9Olvrreb7rKiNdU4LV3tblSaVnVcjumJPL/dxCoOIOYVh+vSuicct2tla7G" new ByteArrayInputStream(
+ "UIXZR9iDKHsZUwh4dcH5KXYvfr9rCyLi7jX/eP7/kv3vKf6larqiD/W0j5n7t4yPkf+35qmyX8t" base64()
+ "7QTZB8AAAAAAAAAAAAAAOAfPAE43i9LACgAAA=="))); .decode(
"H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4V"
+ "n3l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2V"
+ "fG8es77Kcu4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5"
+ "P8XUv6HEE9z/rum6etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];
@ -407,11 +424,15 @@ public class PosixTarHeaderTest {
// echo no wind can soothe my pain >inrain // echo no wind can soothe my pain >inrain
// chmod 0600 liketears inrain // chmod 0600 liketears inrain
// tar --format=ustar -c liketears inrain | gzip | base64 // tar --format=ustar -c liketears inrain | gzip | base64
InputStream input = new GZIPInputStream(new ByteArrayInputStream(base64().decode("" InputStream input =
+ "H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4Vn3" new GZIPInputStream(
+ "l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2VfG8es77Kc" new ByteArrayInputStream(
+ "u4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5P8XUv6HEE9z/rum6" base64()
+ "etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA="))); .decode(
"H4sIAOB8DVIAA+3TTQ6DIBCGYdY9BUcYUPE8pDWV/mCjNsbbF01jurIr25i8z4ZACAxhvlu4V"
+ "n3l205tRxInoqTIjXUuzY1xRub1WVYqY61ktnSmyJUYWzhRWjasafHset+mUi6+7df2V"
+ "fG8es77Kcu4E7HRrQ9RH33Ug+9q7Qc/6vuo56Y4/Ls8bCzE6fu3veN7/rOP/Lsp/1Jk5"
+ "P8XUv6HEE9z/rum6etqCv8j9QTZBwAAAAAAAAAAAAAA2IMXm3pYMgAoAAA=")));
PosixTarHeader header; PosixTarHeader header;
byte[] block = new byte[512]; byte[] block = new byte[512];