src/java.base/share/classes/java/nio/X-Buffer.java.template
changeset 49282 271ef464fb3a
parent 49210 7c795d301dbf
child 49581 bd45ce23b1ac
equal deleted inserted replaced
49281:6712bdd93e4e 49282:271ef464fb3a
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  1335     public int compareTo($Type$Buffer that) {
  1335     public int compareTo($Type$Buffer that) {
  1336         int i = BufferMismatch.mismatch(this, this.position(),
  1336         int i = BufferMismatch.mismatch(this, this.position(),
  1337                                         that, that.position(),
  1337                                         that, that.position(),
  1338                                         Math.min(this.remaining(), that.remaining()));
  1338                                         Math.min(this.remaining(), that.remaining()));
  1339         if (i >= 0) {
  1339         if (i >= 0) {
  1340             return compare(this.get(this.position() + i), that.get(this.position() + i));
  1340             return compare(this.get(this.position() + i), that.get(that.position() + i));
  1341         }
  1341         }
  1342         return this.remaining() - that.remaining();
  1342         return this.remaining() - that.remaining();
  1343     }
  1343     }
  1344 
  1344 
  1345     private static int compare($type$ x, $type$ y) {
  1345     private static int compare($type$ x, $type$ y) {