Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34489

Re: OutputStream.write(int)

From Jan Burse <janburse@fastmail.fm>
Newsgroups comp.lang.java.programmer
Subject Re: OutputStream.write(int)
Date 2016-06-06 11:58 +0200
Organization albasani.net
Message-ID <nj3hgj$lj0$1@news.albasani.net> (permalink)
References <nj2ajp$4h$1@Gaia.teknon.de> <nj2di3$k1h$1@news.albasani.net> <nj2q45$407$1@Gaia.teknon.de>

Show all headers | View raw


Volker Borchert schrieb:
> I can see 0x000000, but not 0xffffff. And I'd be more suspicious
> about <0 vs. >=0 than about intermediate bits.

byte is a signed data type. if you accesse a byte array
element you get an int value in the range -128 to 127.
The statement in write(byte[],..) where this happens is this:

        write(b[off + i]);

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OutputStream.write(int) v_borchert@despammed.com (Volker Borchert) - 2016-06-05 22:54 +0000
  Re: OutputStream.write(int) Jan Burse <janburse@fastmail.fm> - 2016-06-06 01:45 +0200
    Re: OutputStream.write(int) v_borchert@despammed.com (Volker Borchert) - 2016-06-06 03:19 +0000
      Re: OutputStream.write(int) Jan Burse <janburse@fastmail.fm> - 2016-06-06 11:58 +0200
        Re: OutputStream.write(int) v_borchert@despammed.com (Volker Borchert) - 2016-06-06 15:51 +0000
  Re: OutputStream.write(int) Arne Vajhøj <arne@vajhoej.dk> - 2016-06-05 20:09 -0400
  Re: OutputStream.write(int) Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2016-06-05 19:38 -0700

csiph-web