@ -8,6 +8,9 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty ;
import javax.validation.constraints.NotNull ;
import java.io.BufferedReader ;
import java.io.FileReader ;
import java.io.IOException ;
import java.util.* ;
@Data
@ -158,6 +161,20 @@ public class TransmissionPojo {
}
public static void main ( String [ ] args ) {
String filePath = "D:\\WeChet\\WeChat Files\\wxid_ttkf0xgmyihv22\\FileStorage\\File\\2024-11\\duoji-web-tcp.log" ; // 替换为你的文件路径
try ( BufferedReader br = new BufferedReader ( new FileReader ( filePath ) ) ) {
String line ;
while ( ( line = br . readLine ( ) ) ! = null ) {
if ( line . contains ( "RTE" ) ) {
line = line . substring ( line . indexOf ( "client:" ) , line . indexOf ( "data length:" ) ) ;
System . out . println ( line ) ;
}
}
} catch ( IOException e ) {
e . printStackTrace ( ) ;
}
//2024-05-31 17:52:07,909 INFO (Decoder.java:96)- receive client:RTE&001/1/9&2812&&2&0341&30&1&.\fileData\\2812\4.PNG;\fileData\\2812\2_0341_rlt.jpg&.\fileData\\2812\4.pcd, data length:106
TransmissionPojo transmissionPojo = new TransmissionPojo ( "RTE&001/1/9&2812&&2&0341&30&1&.\\fileData\\\\2812\\4.PNG;\\fileData\\\\2812\\2_0341_rlt.jpg&.\\fileData\\\\2812\\4.pcd>" ) ;
System . out . println ( transmissionPojo ) ;