Compare commits
1 Commits
dev
...
829790af29
| Author | SHA1 | Date | |
|---|---|---|---|
| 829790af29 |
36
pom.xml
36
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.imyeyu.io</groupId>
|
<groupId>com.imyeyu.io</groupId>
|
||||||
<artifactId>timi-io</artifactId>
|
<artifactId>timi-io</artifactId>
|
||||||
<version>0.0.3</version>
|
<version>0.0.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -28,42 +28,10 @@
|
|||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>3.3.1</version>
|
<version>3.3.1</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok-maven-plugin</artifactId>
|
|
||||||
<version>1.18.20.0</version>
|
|
||||||
<configuration>
|
|
||||||
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
|
|
||||||
<outputDirectory>${project.build.directory}/delombok</outputDirectory>
|
|
||||||
<addOutputDirectory>false</addOutputDirectory>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>generate-sources</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>delombok</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.18.36</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.11.2</version>
|
<version>3.11.2</version>
|
||||||
<configuration>
|
|
||||||
<sourcepath>${project.build.directory}/delombok</sourcepath>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
<charset>UTF-8</charset>
|
|
||||||
<docencoding>UTF-8</docencoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
@@ -92,7 +60,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.imyeyu.utils</groupId>
|
<groupId>com.imyeyu.utils</groupId>
|
||||||
<artifactId>timi-utils</artifactId>
|
<artifactId>timi-utils</artifactId>
|
||||||
<version>0.0.3</version>
|
<version>0.0.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ package com.imyeyu.io;
|
|||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
import com.imyeyu.java.bean.CallbackArg;
|
import com.imyeyu.java.bean.CallbackArg;
|
||||||
import com.imyeyu.utils.Calc;
|
import com.imyeyu.utils.Calc;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -43,18 +41,9 @@ public class IOSpeedService {
|
|||||||
private static IOSpeedService service;
|
private static IOSpeedService service;
|
||||||
|
|
||||||
/** 加盐,用于在数据对齐的 IO 流中看起来像非对齐传输。此操作会使计算数据变得非真实,仅作为 UI 显示时可使用 */
|
/** 加盐,用于在数据对齐的 IO 流中看起来像非对齐传输。此操作会使计算数据变得非真实,仅作为 UI 显示时可使用 */
|
||||||
@Setter
|
|
||||||
@Getter
|
|
||||||
private long salt;
|
private long salt;
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
private double totalBufferOld;
|
private double totalBufferOld, totalBuffer;
|
||||||
|
|
||||||
/** 总缓冲量 */
|
|
||||||
@Getter
|
|
||||||
private double totalBuffer;
|
|
||||||
|
|
||||||
/** true 为运行中 */
|
|
||||||
@Getter
|
|
||||||
private boolean isRunning;
|
private boolean isRunning;
|
||||||
|
|
||||||
private final Map<String, Item> items;
|
private final Map<String, Item> items;
|
||||||
@@ -147,6 +136,15 @@ public class IOSpeedService {
|
|||||||
return items.get(id);
|
return items.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取总缓冲量
|
||||||
|
*
|
||||||
|
* @return 缓冲数据量
|
||||||
|
*/
|
||||||
|
public double getTotalBuffer() {
|
||||||
|
return totalBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
/** 重置计算 */
|
/** 重置计算 */
|
||||||
public void reset() {
|
public void reset() {
|
||||||
totalBufferOld = totalBuffer = 0;
|
totalBufferOld = totalBuffer = 0;
|
||||||
@@ -174,6 +172,23 @@ public class IOSpeedService {
|
|||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否运行中
|
||||||
|
*
|
||||||
|
* @return true 为运行中
|
||||||
|
*/
|
||||||
|
public boolean isRunning() {
|
||||||
|
return isRunning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSalt() {
|
||||||
|
return salt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSalt(long salt) {
|
||||||
|
this.salt = salt;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加全局字节量监听
|
* 添加全局字节量监听
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.imyeyu.io;
|
package com.imyeyu.io;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -18,10 +16,8 @@ import java.util.jar.JarFile;
|
|||||||
* @author 夜雨
|
* @author 夜雨
|
||||||
* @version 2021-12-01 17:39
|
* @version 2021-12-01 17:39
|
||||||
*/
|
*/
|
||||||
@Getter
|
|
||||||
public class JarReader extends JarFile {
|
public class JarReader extends JarFile {
|
||||||
|
|
||||||
/** jar 所有文件的数据流映射列表,Map<路径, 数据流> */
|
|
||||||
private final Map<String, InputStream> files;
|
private final Map<String, InputStream> files;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,4 +76,12 @@ public class JarReader extends JarFile {
|
|||||||
return IO.toBytes(getInputStream(path));
|
return IO.toBytes(getInputStream(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 jar 所有文件的数据流映射列表,Map<路径, 数据流>
|
||||||
|
*
|
||||||
|
* @return 数据流映射列表
|
||||||
|
*/
|
||||||
|
public Map<String, InputStream> getFiles() {
|
||||||
|
return files;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.imyeyu.io;
|
package com.imyeyu.io;
|
||||||
|
|
||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -12,7 +11,6 @@ import java.util.Stack;
|
|||||||
* @author 夜雨
|
* @author 夜雨
|
||||||
* @version 2024-06-30 16:26
|
* @version 2024-06-30 16:26
|
||||||
*/
|
*/
|
||||||
@Getter
|
|
||||||
public class TreeFile extends File {
|
public class TreeFile extends File {
|
||||||
|
|
||||||
private List<TreeFile> children;
|
private List<TreeFile> children;
|
||||||
@@ -59,6 +57,10 @@ public class TreeFile extends File {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<TreeFile> getChildren() {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user