package mapped;

import java.nio.ByteBuffer;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSDirectByteArrayCopier;

@ObfuscatedName("na")
public class DirectByteArrayCopier extends AbstractByteArrayCopier implements RSDirectByteArrayCopier {
   @ObfuscatedName("ao")
   @ObfuscatedGetter(
      intValue = 1472985539
   )
   static int field3822;
   @ObfuscatedName("at")
   ByteBuffer directBuffer;

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(B)[B",
      garbageValue = "5"
   )
   byte[] get_base() {
      byte[] var1 = new byte[this.directBuffer.capacity()];
      this.directBuffer.position(0);
      this.directBuffer.get(var1);
      return var1;
   }

   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "([BB)V",
      garbageValue = "67"
   )
   void set_base(byte[] var1) {
      this.directBuffer = ByteBuffer.allocateDirect(var1.length);
      this.directBuffer.position(0);
      this.directBuffer.put(var1);
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(CI)Z",
      garbageValue = "-946296977"
   )
   public static boolean method6830_base(char var0) {
      if(var0 >= ' ' && var0 < 127 || var0 > 127 && var0 < 160 || var0 > 160 && var0 <= 255) {
         return true;
      } else {
         if(var0 != 0) {
            char[] var1 = class396.cp1252AsciiExtension;

            for(int var2 = 0; var2 < var1.length; ++var2) {
               char var3 = var1[var2];
               if(var0 == var3) {
                  return true;
               }
            }
         }

         return false;
      }
   }
}
