Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7722890e
提交
7722890e
authored
7 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add optimized util.Bits for Java 9 and later versions
上级
b4f16fe3
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
144 行增加
和
3 行删除
+144
-3
Bits.class
h2/src/java9/precompiled/org/h2/util/Bits.class
+0
-0
Bits.java
h2/src/java9/src/org/h2/util/Bits.java
+118
-0
package.html
h2/src/java9/src/org/h2/util/package.html
+14
-0
MANIFEST.MF
h2/src/main/META-INF/MANIFEST.MF
+1
-0
Bits.java
h2/src/main/org/h2/util/Bits.java
+6
-0
Build.java
h2/src/tools/org/h2/build/Build.java
+3
-1
CheckTextFiles.java
h2/src/tools/org/h2/build/code/CheckTextFiles.java
+1
-1
SpellChecker.java
h2/src/tools/org/h2/build/doc/SpellChecker.java
+1
-1
没有找到文件。
h2/src/java9/precompiled/org/h2/util/Bits.class
0 → 100644
浏览文件 @
7722890e
File added
This diff is collapsed.
Click to expand it.
h2/src/java9/src/org/h2/util/Bits.java
0 → 100644
浏览文件 @
7722890e
/*
* Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
util
;
import
java.lang.invoke.MethodHandles
;
import
java.lang.invoke.VarHandle
;
import
java.nio.ByteOrder
;
import
java.util.UUID
;
/**
* Manipulations with bytes and arrays. Specialized implementation for Java 9
* and later versions.
*/
public
final
class
Bits
{
/**
* VarHandle giving access to elements of a byte[] array viewed as if it were a
* int[] array on big-endian system.
*/
private
static
final
VarHandle
INT_VH
=
MethodHandles
.
byteArrayViewVarHandle
(
int
[].
class
,
ByteOrder
.
BIG_ENDIAN
);
/**
* VarHandle giving access to elements of a byte[] array viewed as if it were a
* long[] array on big-endian system.
*/
private
static
final
VarHandle
LONG_VH
=
MethodHandles
.
byteArrayViewVarHandle
(
long
[].
class
,
ByteOrder
.
BIG_ENDIAN
);
/**
* Reads a int value from the byte array at the given position in big-endian
* order.
*
* @param buff
* the byte array
* @param pos
* the position
* @return the value
*/
public
static
int
readInt
(
byte
[]
buff
,
int
pos
)
{
return
(
int
)
INT_VH
.
get
(
buff
,
pos
);
}
/**
* Reads a long value from the byte array at the given position in big-endian
* order.
*
* @param buff
* the byte array
* @param pos
* the position
* @return the value
*/
public
static
long
readLong
(
byte
[]
buff
,
int
pos
)
{
return
(
long
)
LONG_VH
.
get
(
buff
,
pos
);
}
/**
* Converts UUID value to byte array in big-endian order.
*
* @param msb
* most significant part of UUID
* @param lsb
* least significant part of UUID
* @return byte array representation
*/
public
static
byte
[]
uuidToBytes
(
long
msb
,
long
lsb
)
{
byte
[]
buff
=
new
byte
[
16
];
LONG_VH
.
set
(
buff
,
0
,
msb
);
LONG_VH
.
set
(
buff
,
8
,
lsb
);
return
buff
;
}
/**
* Converts UUID value to byte array in big-endian order.
*
* @param uuid
* UUID value
* @return byte array representation
*/
public
static
byte
[]
uuidToBytes
(
UUID
uuid
)
{
return
uuidToBytes
(
uuid
.
getMostSignificantBits
(),
uuid
.
getLeastSignificantBits
());
}
/**
* Writes a int value to the byte array at the given position in big-endian
* order.
*
* @param buff
* the byte array
* @param pos
* the position
* @param x
* the value to write
*/
public
static
void
writeInt
(
byte
[]
buff
,
int
pos
,
int
x
)
{
INT_VH
.
set
(
buff
,
pos
,
x
);
}
/**
* Writes a long value to the byte array at the given position in big-endian
* order.
*
* @param buff
* the byte array
* @param pos
* the position
* @param x
* the value to write
*/
public
static
void
writeLong
(
byte
[]
buff
,
int
pos
,
long
x
)
{
LONG_VH
.
set
(
buff
,
pos
,
x
);
}
private
Bits
()
{
}
}
This diff is collapsed.
Click to expand it.
h2/src/java9/src/org/h2/util/package.html
0 → 100644
浏览文件 @
7722890e
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0, Version 1.0,
and under the Eclipse Public License, Version 1.0
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Javadoc package documentation
</title></head><body
style=
"font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"
><p>
Internal utility classes reimplemented for Java 9 and later versions.
</p></body></html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
h2/src/main/META-INF/MANIFEST.MF
浏览文件 @
7722890e
...
...
@@ -13,6 +13,7 @@ Bundle-Vendor: H2 Group
Bundle-Version: ${version}
Bundle-License: http://www.h2database.com/html/license.html
Bundle-Category: jdbc
Multi-Release: true
Import-Package: javax.management,
javax.naming;resolution:=optional,
javax.naming.spi;resolution:=optional,
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/Bits.java
浏览文件 @
7722890e
...
...
@@ -14,6 +14,12 @@ import java.util.UUID;
*/
public
final
class
Bits
{
/*
* Signatures of methods should match with
* h2/src/java9/src/org/h2/util/Bits.java and precompiled
* h2/src/java9/precompiled/org/h2/util/Bits.class.
*/
/**
* Reads a int value from the byte array at the given position in big-endian
* order.
...
...
This diff is collapsed.
Click to expand it.
h2/src/tools/org/h2/build/Build.java
浏览文件 @
7722890e
...
...
@@ -446,8 +446,10 @@ public class Build extends BuildBase {
@Description
(
summary
=
"Create the regular h2.jar file."
)
public
void
jar
()
{
compile
();
FileList
files
=
files
(
"src/java9/precompiled"
);
copy
(
"temp/META-INF/versions/9"
,
files
,
"src/java9/precompiled"
);
manifest
(
"H2 Database Engine"
,
"org.h2.tools.Console"
);
FileList
files
=
files
(
"temp"
).
files
=
files
(
"temp"
).
exclude
(
"temp/android/*"
).
exclude
(
"temp/org/h2/android/*"
).
exclude
(
"temp/org/h2/build/*"
).
...
...
This diff is collapsed.
Click to expand it.
h2/src/tools/org/h2/build/code/CheckTextFiles.java
浏览文件 @
7722890e
...
...
@@ -30,7 +30,7 @@ public class CheckTextFiles {
"Driver"
,
"Processor"
,
"prefs"
};
private
static
final
String
[]
SUFFIX_IGNORE
=
{
"gif"
,
"png"
,
"odg"
,
"ico"
,
"sxd"
,
"layout"
,
"res"
,
"win"
,
"jar"
,
"task"
,
"svg"
,
"MF"
,
"mf"
,
"sh"
,
"DS_Store"
,
"prop"
};
"sh"
,
"DS_Store"
,
"prop"
,
"class"
};
private
static
final
String
[]
SUFFIX_CRLF
=
{
"bat"
};
private
static
final
boolean
ALLOW_TAB
=
false
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/tools/org/h2/build/doc/SpellChecker.java
浏览文件 @
7722890e
...
...
@@ -31,7 +31,7 @@ public class SpellChecker {
"properties"
,
"task"
,
"MF"
,
"mf"
,
"sh"
,
""
};
private
static
final
String
[]
IGNORE
=
{
"dev"
,
"nsi"
,
"gif"
,
"png"
,
"odg"
,
"ico"
,
"sxd"
,
"zip"
,
"bz2"
,
"rc"
,
"layout"
,
"res"
,
"dll"
,
"jar"
,
"svg"
,
"prefs"
,
"prop"
,
"iml"
};
"svg"
,
"prefs"
,
"prop"
,
"iml"
,
"class"
};
private
static
final
String
DELIMITERS
=
" \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t"
;
private
static
final
String
PREFIX_IGNORE
=
"abc"
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论