minor: docs
This commit is contained in:
parent
6a09b141fd
commit
43452da5c6
|
@ -168,7 +168,7 @@ module Mongo
|
|||
(@file_length / @chunk_size).to_i
|
||||
end
|
||||
|
||||
# An optimized read method for reading the whole file.
|
||||
# Read a file in its entirety (optimized).
|
||||
def read_all
|
||||
buf = ''
|
||||
while true
|
||||
|
@ -179,6 +179,7 @@ module Mongo
|
|||
buf
|
||||
end
|
||||
|
||||
# Read a file incrementally.
|
||||
def read_length(length)
|
||||
cache_chunk_data
|
||||
remaining = (@file_length - @file_position)
|
||||
|
|
|
@ -50,6 +50,9 @@ class GridTest < Test::Unit::TestCase
|
|||
file = @grid.get(id)
|
||||
io.rewind
|
||||
data = io.read
|
||||
if data.respond_to?(:force_encoding)
|
||||
data.force_encoding(:binary)
|
||||
end
|
||||
read_data = ""
|
||||
while(chunk = file.read(read_length))
|
||||
read_data << chunk
|
||||
|
|
Loading…
Reference in New Issue