package com.l7tech.server.transport.jms;

import com.l7tech.util.CausedIOException;
import java.io.IOException;
import java.io.InputStream;
import javax.jms.BytesMessage;
import javax.jms.JMSException;

public class BytesMessageInputStream extends InputStream {
   private final BytesMessage a;

   public BytesMessageInputStream(BytesMessage var1) {
      this.a = var1;
   }

   @Override
   public int read() throws IOException {
      try {
         return this.a.readByte();
      } catch (JMSException var2) {
         throw new CausedIOException(var2);
      }
   }

   @Override
   public synchronized int read(byte[] param1, int param2, int param3) throws IOException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: iload 2
      // 01: ifne 14
      // 04: aload 0
      // 05: getfield com/l7tech/server/transport/jms/BytesMessageInputStream.a Ljavax/jms/BytesMessage;
      // 08: aload 1
      // 09: iload 3
      // 0a: invokeinterface javax/jms/BytesMessage.readBytes ([BI)I 3
      // 0f: ireturn
      // 10: invokestatic com/l7tech/server/transport/jms/BytesMessageInputStream.a (Ljava/io/IOException;)Ljava/io/IOException;
      // 13: athrow
      // 14: iload 3
      // 15: newarray 8
      // 17: astore 4
      // 19: aload 0
      // 1a: getfield com/l7tech/server/transport/jms/BytesMessageInputStream.a Ljavax/jms/BytesMessage;
      // 1d: aload 4
      // 1f: iload 3
      // 20: invokeinterface javax/jms/BytesMessage.readBytes ([BI)I 3
      // 25: istore 5
      // 27: iload 5
      // 29: ifge 2f
      // 2c: iload 5
      // 2e: ireturn
      // 2f: aload 4
      // 31: bipush 0
      // 32: aload 1
      // 33: iload 2
      // 34: iload 3
      // 35: invokestatic java/lang/System.arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V
      // 38: iload 5
      // 3a: ireturn
      // 3b: astore 4
      // 3d: new com/l7tech/util/CausedIOException
      // 40: dup
      // 41: aload 4
      // 43: invokespecial com/l7tech/util/CausedIOException.<init> (Ljava/lang/Throwable;)V
      // 46: athrow
      // try (0 -> 7): 31 javax/jms/JMSException
      // try (0 -> 8): 8 java/io/IOException
      // try (10 -> 22): 31 javax/jms/JMSException
      // try (23 -> 30): 31 javax/jms/JMSException
   }

   private static IOException a(IOException var0) {
      return var0;
   }
}
