update ChunkedFile to seekable reader, so we can use io.* to read data

This commit is contained in:
tnextday
2015-12-01 20:23:50 +08:00
parent f825d23789
commit 6b0894d806
5 changed files with 313 additions and 65 deletions

View File

@@ -16,7 +16,7 @@ const (
FlagHasMime = 0x04
FlagHasLastModifiedDate = 0x08
FlagHasTtl = 0x10
FlagChunkList = 0x80
FlagChunkedFile = 0x80
LastModifiedBytesLength = 5
TtlBytesLength = 2
)
@@ -282,10 +282,10 @@ func (n *Needle) SetHasTtl() {
n.Flags = n.Flags | FlagHasTtl
}
func (n *Needle) IsChunkList() bool {
return n.Flags&FlagChunkList > 0
func (n *Needle) IsChunkedFile() bool {
return n.Flags&FlagChunkedFile > 0
}
func (n *Needle) SetChunkList() {
n.Flags = n.Flags | FlagChunkList
func (n *Needle) SetChunkedFile() {
n.Flags = n.Flags | FlagChunkedFile
}