Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
203902a7
提交
203902a7
authored
11月 29, 2012
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The "textMode" field in the FileStore class was from an old feature that got removed, so it can go
上级
c5b9c3e0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
28 行删除
+5
-28
FileStore.java
h2/src/main/org/h2/store/FileStore.java
+0
-13
FileStoreInputStream.java
h2/src/main/org/h2/store/FileStoreInputStream.java
+5
-15
没有找到文件。
h2/src/main/org/h2/store/FileStore.java
浏览文件 @
203902a7
...
...
@@ -54,7 +54,6 @@ public class FileStore {
private
boolean
checkedWriting
=
true
;
private
final
String
mode
;
private
TempFileDeleter
tempFileDeleter
;
private
boolean
textMode
;
private
java
.
nio
.
channels
.
FileLock
lock
;
/**
...
...
@@ -200,9 +199,6 @@ public class FileStore {
initKey
(
salt
);
// read (maybe) encrypted
readFully
(
buff
,
0
,
Constants
.
FILE_BLOCK_SIZE
);
if
(
textMode
)
{
buff
[
10
]
=
'B'
;
}
if
(
Utils
.
compareNotNull
(
buff
,
magic
)
!=
0
)
{
throw
DbException
.
get
(
ErrorCode
.
FILE_ENCRYPTION_ERROR_1
,
name
);
}
...
...
@@ -471,15 +467,6 @@ public class FileStore {
}
}
/**
* Check if the file store is in text mode.
*
* @return true if it is
*/
public
boolean
isTextMode
()
{
return
textMode
;
}
/**
* Try to lock the file.
*
...
...
h2/src/main/org/h2/store/FileStoreInputStream.java
浏览文件 @
203902a7
...
...
@@ -91,7 +91,7 @@ public class FileStoreInputStream extends InputStream {
}
store
.
readFully
(
page
.
getBytes
(),
0
,
Constants
.
FILE_BLOCK_SIZE
);
page
.
reset
();
remainingInBuffer
=
readInt
();
remainingInBuffer
=
page
.
readInt
();
if
(
remainingInBuffer
<
0
)
{
close
();
return
;
...
...
@@ -100,18 +100,18 @@ public class FileStoreInputStream extends InputStream {
// get the length to read
if
(
compress
!=
null
)
{
page
.
checkCapacity
(
Data
.
LENGTH_INT
);
readInt
();
page
.
readInt
();
}
page
.
setPos
(
page
.
length
()
+
remainingInBuffer
);
page
.
fillAligned
();
int
len
=
page
.
length
()
-
Constants
.
FILE_BLOCK_SIZE
;
page
.
reset
();
readInt
();
page
.
readInt
();
store
.
readFully
(
page
.
getBytes
(),
Constants
.
FILE_BLOCK_SIZE
,
len
);
page
.
reset
();
readInt
();
page
.
readInt
();
if
(
compress
!=
null
)
{
int
uncompressed
=
readInt
();
int
uncompressed
=
page
.
readInt
();
byte
[]
buff
=
Utils
.
newBytes
(
remainingInBuffer
);
page
.
read
(
buff
,
0
,
remainingInBuffer
);
page
.
reset
();
...
...
@@ -149,14 +149,4 @@ public class FileStoreInputStream extends InputStream {
return
i
;
}
private
int
readInt
()
{
if
(
store
.
isTextMode
())
{
byte
[]
buff
=
new
byte
[
8
];
page
.
read
(
buff
,
0
,
8
);
String
s
=
new
String
(
buff
);
return
Integer
.
parseInt
(
s
,
16
);
}
return
page
.
readInt
();
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论