Bytes in Java are signed as well. This would work for PureBasic but it would certainly break backwards compatibility.DarkDragon wrote:Yes but its no byte in purebasic. Byte in PB is signed (in Java too, but see the next sentence). In java it reads a byte, but returns an int, not a byte.Mistrel wrote:Java works around this by returning an int which is either 0-255 or -1 if the stream has ended.
[Seen]ReadByte - cant differentiate between 0 and error
Re: ReadByte - cant differentiate between reading 0 and erro
-
- Addict
- Posts: 2228
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: ReadByte - cant differentiate between reading 0 and erro
I said exactly that.Mistrel wrote:Bytes in Java are signed as well.DarkDragon wrote:Yes but its no byte in purebasic. Byte in PB is signed (in Java too, but see the next sentence). In java it reads a byte, but returns an int, not a byte.Mistrel wrote:Java works around this by returning an int which is either 0-255 or -1 if the stream has ended.
bye,
Daniel
Daniel
- Andre
- PureBasic Team
- Posts: 2058
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: [Seen]ReadByte - cant differentiate between 0 and error
Can be closed, or does anyone have a specific suggestion for needed Doc changes/remarks?