Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



WHILE loops and InputStreams


18 replies to this topic - - - - -

#16 OP SPEhosting

    C++ n00b

  • 2,420 posts
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 07 December 2012 - 04:54

View Postkjordan2001, on 06 December 2012 - 16:19, said:

while ((read=in.read(buf, 0, 4096)) > 0) {

this is going good so far :D just one smmmallllll issue .... the code I have at the moment only works if the sending is within the while loop (which is fine) but its adding all the previous messages on to it :3 imma try flushing it but im pretty sure that will just clear everything except the last byte


#17 kjordan2001

    Mystery Solver

  • 9,842 posts
  • Joined: 27-May 02

Posted 07 December 2012 - 16:47

View PostSPEhosting, on 07 December 2012 - 04:54, said:

this is going good so far :D just one smmmallllll issue .... the code I have at the moment only works if the sending is within the while loop (which is fine) but its adding all the previous messages on to it :3 imma try flushing it but im pretty sure that will just clear everything except the last byte
It's not something like you're re-using the CharArrayWriter instance without calling reset() on it, is it?

#18 OP SPEhosting

    C++ n00b

  • 2,420 posts
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 07 December 2012 - 20:51

View Postkjordan2001, on 07 December 2012 - 16:47, said:

It's not something like you're re-using the CharArrayWriter instance without calling reset() on it, is it?

it might be O.o .... im not that knowledgeable on all these things yet ... I only know whatI have used and i have never used the reset xD last year all my work was mainly GUI and logic based rather then using all the libraries :p i will look into this reset function .... I tried nulling it so javas garbage collection would handle it but that messed things up

#19 OP SPEhosting

    C++ n00b

  • 2,420 posts
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 08 December 2012 - 00:26

View Postkjordan2001, on 07 December 2012 - 16:47, said:

It's not something like you're re-using the CharArrayWriter instance without calling reset() on it, is it?

ok reset and all that works BUT OMG 2bytes are being added somewhere and I dont know why or how ... it says on the sending side its 256...then on the recieving side when it goes to decrypt it... its apprently 258 ...