Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1516,9 +1516,9 @@ public int getTranslateY(Object graphics) {
* said color value.
*
* @param graphics the graphics context
* @param RGB the RGB value for the color.
* @param rgb the RGB value for the color.
*/
public abstract void setColor(Object graphics, int RGB);
public abstract void setColor(Object graphics, int rgb);

/**
* Alpha value from 0-255 can be ignored for some operations
Expand Down
1,152 changes: 573 additions & 579 deletions CodenameOne/src/com/codename1/io/gzip/Deflate.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void write(byte[] b, int off, int len) throws IOException {
} else {
int flush = syncFlush ? JZlib.Z_SYNC_FLUSH : JZlib.Z_NO_FLUSH;
deflater.setInput(b, off, len, true);
while (deflater.avail_in > 0) {
while (deflater.availIn > 0) {
int err = deflate(flush);
if (err == JZlib.Z_STREAM_END)
break;
Expand Down Expand Up @@ -124,14 +124,14 @@ protected int deflate(int flush) throws IOException {
case JZlib.Z_STREAM_END:
break;
case JZlib.Z_BUF_ERROR:
if (deflater.avail_in <= 0 && flush != JZlib.Z_FINISH) {
if (deflater.availIn <= 0 && flush != JZlib.Z_FINISH) {
// flush() without any data
break;
}
default:
throw new IOException("failed to deflate");
}
int len = deflater.next_out_index;
int len = deflater.nextOutIndex;
if (len > 0) {
out.write(buffer, 0, len);
}
Expand All @@ -142,7 +142,7 @@ public void flush() throws IOException {
if (syncFlush && !deflater.finished()) {
while (true) {
int err = deflate(JZlib.Z_SYNC_FLUSH);
if (deflater.next_out_index < buffer.length)
if (deflater.nextOutIndex < buffer.length)
break;
if (err == JZlib.Z_STREAM_END)
break;
Expand Down
32 changes: 16 additions & 16 deletions CodenameOne/src/com/codename1/io/gzip/GZIPHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,30 @@ void put(Deflate d) {
xfl |= 2;
}

d.put_short((short) 0x8b1f); // ID1 ID2
d.put_byte((byte) 8); // CM(Compression Method)
d.put_byte((byte) flag);
d.put_byte((byte) mtime);
d.put_byte((byte) (mtime >> 8));
d.put_byte((byte) (mtime >> 16));
d.put_byte((byte) (mtime >> 24));
d.put_byte((byte) xfl);
d.put_byte((byte) os);
d.putShort((short) 0x8b1f); // ID1 ID2
d.putByte((byte) 8); // CM(Compression Method)
d.putByte((byte) flag);
d.putByte((byte) mtime);
d.putByte((byte) (mtime >> 8));
d.putByte((byte) (mtime >> 16));
d.putByte((byte) (mtime >> 24));
d.putByte((byte) xfl);
d.putByte((byte) os);

if (extra != null) {
d.put_byte((byte) extra.length);
d.put_byte((byte) (extra.length >> 8));
d.put_byte(extra, 0, extra.length);
d.putByte((byte) extra.length);
d.putByte((byte) (extra.length >> 8));
d.putByte(extra, 0, extra.length);
}

if (name != null) {
d.put_byte(name, 0, name.length);
d.put_byte((byte) 0);
d.putByte(name, 0, name.length);
d.putByte((byte) 0);
}

if (comment != null) {
d.put_byte(comment, 0, comment.length);
d.put_byte((byte) 0);
d.putByte(comment, 0, comment.length);
d.putByte((byte) 0);
}
}

Expand Down
16 changes: 8 additions & 8 deletions CodenameOne/src/com/codename1/io/gzip/GZIPInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public void readHeader() throws IOException {
if (n > 0) {
inflater.setInput(b, 0, n, false);
//inflater.next_in_index = n;
inflater.next_in_index = 0;
inflater.avail_in = n;
inflater.nextInIndex = 0;
inflater.availIn = n;
}
throw new IOException("no input");
}
Expand All @@ -97,7 +97,7 @@ public void readHeader() throws IOException {

byte[] b1 = new byte[1];
do {
if (inflater.avail_in <= 0) {
if (inflater.availIn <= 0) {
int i = in.read(b1);
if (i <= 0)
throw new IOException("no input");
Expand All @@ -107,19 +107,19 @@ public void readHeader() throws IOException {
int err = inflater.inflate(JZlib.Z_NO_FLUSH);

if (err != 0/*Z_OK*/) {
int len = 2048 - inflater.next_in.length;
int len = 2048 - inflater.nextIn.length;
if (len > 0) {
byte[] tmp = new byte[len];
n = fill(tmp);
if (n > 0) {
inflater.avail_in += inflater.next_in_index;
inflater.next_in_index = 0;
inflater.availIn += inflater.nextInIndex;
inflater.nextInIndex = 0;
inflater.setInput(tmp, 0, n, true);
}
}
//inflater.next_in_index = inflater.next_in.length;
inflater.avail_in += inflater.next_in_index;
inflater.next_in_index = 0;
inflater.availIn += inflater.nextInIndex;
inflater.nextInIndex = 0;
throw new IOException(inflater.msg);
}
}
Expand Down
Loading
Loading