• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 The Guava Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14 
15 package com.google.common.io;
16 
17 import com.google.common.annotations.GwtIncompatible;
18 import com.google.common.annotations.J2ktIncompatible;
19 import java.nio.Buffer;
20 
21 /**
22  * Wrappers around {@link Buffer} methods that are covariantly overridden in Java 9+. See
23  * https://github.com/google/guava/issues/3990
24  */
25 @J2ktIncompatible
26 @GwtIncompatible
27 @ElementTypesAreNonnullByDefault
28 final class Java8Compatibility {
clear(Buffer b)29   static void clear(Buffer b) {
30     b.clear();
31   }
32 
flip(Buffer b)33   static void flip(Buffer b) {
34     b.flip();
35   }
36 
limit(Buffer b, int limit)37   static void limit(Buffer b, int limit) {
38     b.limit(limit);
39   }
40 
mark(Buffer b)41   static void mark(Buffer b) {
42     b.mark();
43   }
44 
position(Buffer b, int position)45   static void position(Buffer b, int position) {
46     b.position(position);
47   }
48 
reset(Buffer b)49   static void reset(Buffer b) {
50     b.reset();
51   }
52 
Java8Compatibility()53   private Java8Compatibility() {}
54 }
55