Skip to content

Commit

Permalink
Updated the sample to show that it's actually the writes that are cra…
Browse files Browse the repository at this point in the history
…shing.
  • Loading branch information
danadrew committed Jun 27, 2012
1 parent 629a985 commit 33d813e
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions samples/test/dataBuffer-read-crash/main.lua
Expand Up @@ -4,23 +4,17 @@
-- http://getmoai.com
----------------------------------------------------------------

buffer = MOAIDataBuffer.new ()
buffer:load ( 'test.txt' )
stream = MOAIDataBufferStream.new ()

buffer = MOAIDataBuffer.new ()
buffer:load ( 'test.txt' )
stream = MOAIDataBufferStream.new ()
stream:open ( buffer )

i = 0

while 100 > i do -- Testing 8 bit read and write capabilities
stream:write8 ( 10, 12, -14 )

i = i + 1
end

stream:flush ()
stream:seek ()

stream:seek ( 35 )
print ( stream:read8 ())
stream:write8 ( 10 )
stream:write8 ( 10 )
stream:write8 ( 10 )
stream:write8 ( 10 )
stream:write8 ( 10 )

stream:close ()

0 comments on commit 33d813e

Please sign in to comment.