feat(init): 📌 初始化项目
This commit is contained in:
commit
421ceb0d2a
|
@ -0,0 +1,8 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="demo1" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/demo1/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/demo1/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/demo1/src/main/resources-filtered" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/demo1/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/bytebuffter.iml" filepath="$PROJECT_DIR$/.idea/bytebuffter.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>demo1</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,33 @@
|
||||||
|
package cn.bunny;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.FileChannel;
|
||||||
|
|
||||||
|
public class Demo01 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// 输入流
|
||||||
|
try (FileChannel channel = new FileInputStream("D:\\MyFolder\\Netty\\byteBuffter\\data.txt").getChannel()) {
|
||||||
|
// 准备缓冲区
|
||||||
|
ByteBuffer byteBuffer = ByteBuffer.allocate(10);
|
||||||
|
while (true) {
|
||||||
|
// 从channel 向buffer输入
|
||||||
|
int len = channel.read(byteBuffer);
|
||||||
|
if (len == -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 输出buffer内容
|
||||||
|
byteBuffer.flip();
|
||||||
|
while (byteBuffer.hasRemaining()) {
|
||||||
|
byte b = byteBuffer.get();
|
||||||
|
System.out.println((char) b);
|
||||||
|
}
|
||||||
|
|
||||||
|
byteBuffer.clear();
|
||||||
|
}
|
||||||
|
} catch (IOException exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package cn.bunny;
|
||||||
|
|
||||||
|
public class Demo02 {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("asda");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package cn.bunny;
|
||||||
|
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
public class Demo3 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ByteBuffer buffer = ByteBuffer.allocate(10);
|
||||||
|
buffer.put((byte) 0x61);
|
||||||
|
buffer.put(new byte[]{0x62, 0x63, 0x64});
|
||||||
|
|
||||||
|
System.out.println(buffer);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
sadasdsa das das dasas
|
||||||
|
dasasd
|
||||||
|
as
|
||||||
|
dasasdd as dasas
|
||||||
|
as
|
||||||
|
|
||||||
|
ad
|
||||||
|
a sadasdsa
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
||||||
|
sadasdsa das das dasas
|
||||||
|
dasasd
|
||||||
|
as
|
||||||
|
dasasdd as dasas
|
||||||
|
as
|
||||||
|
|
||||||
|
ad
|
||||||
|
a sadasdsa
|
|
@ -0,0 +1,5 @@
|
||||||
|
D:\MyFolder\Netty\bytebuffter\demo1\src\main\java\cn\bunny\ByteBufferUtil.java
|
||||||
|
D:\MyFolder\Netty\bytebuffter\demo1\src\main\java\cn\bunny\Demo01.java
|
||||||
|
D:\MyFolder\Netty\bytebuffter\demo1\src\main\java\cn\bunny\Demo3.java
|
||||||
|
D:\MyFolder\Netty\bytebuffter\demo1\src\main\java\cn\bunny\Demo02.java
|
||||||
|
D:\MyFolder\Netty\bytebuffter\demo1\src\main\java\cn\bunny\Main.java
|
Loading…
Reference in New Issue