-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc0323d
commit 2fd9f91
Showing
13 changed files
with
165 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/target/ | ||
./target/ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This configuration file was automatically generated by Gitpod. | ||
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) | ||
# and commit this file to your remote git repository to share the goodness with others. | ||
|
||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart | ||
|
||
tasks: | ||
- init: mvn install -DskipTests=false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.apt.aptEnabled=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | ||
org.eclipse.jdt.core.compiler.compliance=1.5 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore | ||
org.eclipse.jdt.core.compiler.processAnnotations=disabled | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=1.5 | ||
org.eclipse.jdt.core.compiler.source=1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.voyager.torrent.util; | ||
|
||
import java.nio.ByteBuffer; | ||
import java.util.ArrayDeque; | ||
import java.util.Deque; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class PrintUtil { | ||
public static void printTreeUsingCollections(Map<ByteBuffer, Object> map) { | ||
// Pilha para simular recursão e gerenciar níveis | ||
Deque<Object[]> stack = new ArrayDeque<>(); | ||
stack.push(new Object[]{map, 0}); // Adiciona o mapa inicial com nível 0 | ||
|
||
while (!stack.isEmpty()) { | ||
Object[] current = stack.pop(); | ||
Object element = current[0]; | ||
int depth = (int) current[1]; | ||
|
||
String indent = " ".repeat(depth * 4); // Indentação baseada na profundidade | ||
|
||
if (element instanceof Map) { | ||
Map<?, ?> currentMap = (Map<?, ?>) element; | ||
for (Map.Entry<?, ?> entry : currentMap.entrySet()) { | ||
String key = new String(((ByteBuffer) entry.getKey()).array()); | ||
System.out.println(indent + "- " + key + ":"); | ||
|
||
Object value = entry.getValue(); | ||
if (value instanceof Map || value instanceof List) { | ||
stack.push(new Object[]{value, depth + 1}); // Adiciona à pilha | ||
} else { | ||
System.out.println(indent + " " + value); | ||
} | ||
} | ||
} else if (element instanceof List) { | ||
List<?> currentList = (List<?>) element; | ||
for (Object item : currentList) { | ||
if (item instanceof Map || item instanceof List) { | ||
stack.push(new Object[]{item, depth + 1}); // Adiciona à pilha | ||
} else { | ||
System.out.println(indent + "- " + item); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file modified
BIN
+1.19 KB
(120%)
target/classes/org/voyager/torrent/client/ClientTorrent.class
Binary file not shown.