text:
namespace net {
class DrainableIOBuffer;
class IOBufferWithSize;
}

namespace storage {
class FileStreamReader;
class ShareableFileReference;
enum class FlushPolicy;
}

namespace storage {

class CopyOrMoveFileValidator;
class FileStreamWriter;

// A delegate class for recursive copy or move operations.
class CopyOrMoveOperationDelegate
    : public RecursiveOperationDelegate {
 public:
  class CopyOrMoveImpl;
  typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback;
  typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption;

  enum OperationType {
    OPERATION_COPY,
    OPERATION_MOVE
  };

  // Helper to copy a file by reader and writer streams.
  // Export for testing.
  class STORAGE_EXPORT StreamCopyHelper {
   public:
    StreamCopyHelper(
        scoped_ptr<storage::FileStreamReader> reader,
        scoped_ptr<FileStreamWriter> writer,
        FlushPolicy flush_policy,
        int buffer_size,
        const FileSystemOperation::CopyFileProgressCallback&
            file_progress_callback,
        const base::TimeDelta& min_progress_callback_invocation_span);
    ~StreamCopyHelper();

    void Run(const StatusCallback& callback);

    // Requests cancelling. After the cancelling is done, |callback| passed to
    // Run will be called.
    void Cancel();

   private:
    // Reads the content from the |reader_|.
    void Read(const StatusCallback& callback);
    void DidRead(const StatusCallback& callback, int result);

    // Writes the content in |buffer| to |writer_|.
    void Write(const StatusCallback& callback,
               scoped_refptr<net::DrainableIOBuffer> buffer);
    void DidWrite(const StatusCallback& callback,
                  scoped_refptr<net::DrainableIOBuffer> buffer, int result);

    // Flushes the written content in |writer_|.
    void Flush(const StatusCallback& callback, bool is_eof);
    void DidFlush(const StatusCallback& callback, bool is_eof, int result);

    scoped_ptr<storage::FileStreamReader> reader_;
    scoped_ptr<FileStreamWriter> writer_;
    const FlushPolicy flush_policy_;
    FileSystemOperation::CopyFileProgressCallback file_progress_callback_;
    scoped_refptr<net::IOBufferWithSize> io_buffer_;
    int64 num_copied_bytes_;
    int64 previous_flush_offset_;
    base::Time last_progress_callback_invocation_time_;
    base::TimeDelta min_progress_callback_invocation_span_;
    bool cancel_requested_;
    base::WeakPtrFactory<StreamCopyHelper> weak_factory_;
    DISALLOW_COPY_AND_ASSIGN(StreamCopyHelper);
  };

  CopyOrMoveOperationDelegate(
      FileSystemContext* file_system_context,
      const FileSystemURL& src_root,
      const FileSystemURL& dest_root,
      OperationType operation_type,
      CopyOrMoveOption option,
      const CopyProgressCallback& progress_callback,
      const StatusCallback& callback);
  ~CopyOrMoveOperationDelegate() override;

  // RecursiveOperationDelegate overrides:
  void Run() override;
  void RunRecursively() override;
  void ProcessFile(const FileSystemURL& url,
                   const StatusCallback& callback) override;
  void ProcessDirectory(const FileSystemURL& url,
                        const StatusCallback& callback) override;
  void PostProcessDirectory(const FileSystemURL& url,
                            const StatusCallback& callback) override;

 protected:
  void OnCancel() override;

 private:
  void DidCopyOrMoveFile(const FileSystemURL& src_url,
                         const FileSystemURL& dest_url,
                         const StatusCallback& callback,
                         CopyOrMoveImpl* impl,
                         base::File::Error error);
  void DidTryRemoveDestRoot(const StatusCallback& callback,
                            base::File::Error error);
  void ProcessDirectoryInternal(const FileSystemURL& src_url,
                                const FileSystemURL& dest_url,
                                const StatusCallback& callback);
  void DidCreateDirectory(const FileSystemURL& src_url,
                          const FileSystemURL& dest_url,
                          const StatusCallback& callback,
                          base::File::Error error);
  void PostProcessDirectoryAfterGetMetadata(
      const FileSystemURL& src_url,
      const StatusCallback& callback,
      base::File::Error error,
      const base::File::Info& file_info);
  void PostProcessDirectoryAfterTouchFile(const FileSystemURL& src_url,
                                          const StatusCallback& callback,
                                          base::File::Error error);
  void DidRemoveSourceForMove(const StatusCallback& callback,
                              base::File::Error error);

  void OnCopyFileProgress(const FileSystemURL& src_url, int64 size);
  FileSystemURL CreateDestURL(const FileSystemURL& src_url) const;

  FileSystemURL src_root_;
  FileSystemURL dest_root_;
  bool same_file_system_;
  OperationType operation_type_;
  CopyOrMoveOption option_;
  CopyProgressCallback progress_callback_;
  StatusCallback callback_;

  std::set<CopyOrMoveImpl*> running_copy_set_;
  base::WeakPtrFactory<CopyOrMoveOperationDelegate> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationDelegate);
};

}  // namespace storage

#endif  // STORAGE_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_

redpajama_set_name: RedPajamaGithub


text:
/*
vi:noexpandtab:ts=2:sw=2
*/

#ifndef _UTIL_H
#define _UTIL_H

typedef unsigned char u8;
typedef unsigned int u32;
typedef unsigned long long u64;

/* 8MB should be future proof for at least a couple of years...  */
#define DEFAULT_BLOCK_SIZE 8*1024*1024

void showstatus(u64 pos);

struct showstatus_state
{
	u64 last_usec;
	u64 last_pos;
	u64 size;
	u64 written;
	double size_human;
	char *size_units;
};

void showstatus_init(struct showstatus_state *stat, u64 pos, u64 size, int read_before_write);
void showstatus_timed(u64 pos, struct showstatus_state *stat, char *msg);

unsigned int sd_erase_size(char *filename);

u64 dev_size(char *filename);

double human_size(double size, char **units);
u64 interpret_number(char *val);

#endif


text:
Input Modules
-------------

Input modules are used to gather messages from various sources. They
interface to message generators. They are generally defined via the
:doc:`input <../input>` configuration object.

.. toctree::
   :glob:
   :maxdepth: 1

   im*


text:
#include<iostream>
#include<fstream>
#include<string>
#include"TestMultiThread.h"

using namespace std;

void increment(file fileName) {
    cout << "INIT TASK" << endl;
    cout << "Param: " << fileName << endl;
    // Read value
    char initialValue;
    ifstream fis (fileName);
    if (fis.is_open()) {
        if (fis >> initialValue) {
            fis.close();
        } else {
            cerr << "[ERROR] Unable to read final value" << endl;
            fis.close();
        }
        fis.close();
    } else {
        cerr << "[ERROR] Unable to open file" << endl;
    }

    // Increment
    cout << "INIT VALUE: " << initialValue << endl;
    int finalValue = ((int)(initialValue) - (int)('0')) + 1;
    cout << "FINAL VALUE: " << finalValue << endl;

    // Write new value
    ofstream fos (fileName);
    if (fos.is_open()) {
        fos << finalValue << endl;
        fos.close();
    } else {
        cerr << "[ERROR] Unable to open file" << endl;
    }
    cout << "END TASK" << endl;
}


text:
package org.sterl.gcm.android;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.google.android.gms.gcm.GoogleCloudMessaging;

import java.io.IOException;
import java.util.UUID;

public class SendMessageDialogFragment extends DialogFragment {

    ProgressDialog progressDialog;
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        // Get the layout inflater
        LayoutInflater inflater = getActivity().getLayoutInflater();

        // Inflate and set the layout for the dialog
        // Pass null as the parent view because its going in the dialog layout
        final String to = getString(R.string.gcm_project_number);
        final View view = inflater.inflate(R.layout.send_message_dialog_layout, null);
        builder.setView(view)
                .setTitle("Send Message to " + to)
                // Add action buttons
                .setPositiveButton("Send", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int id) {

                        final CharSequence message = ((EditText) view.findViewById(R.id.txtMessage)).getText();

                        progressDialog = ProgressDialog.show(getActivity(), "Sending message", "Sending your message '" + message + "' to " + to);

                        new AsyncTask<Void, Void, String>() {
                            @Override
                            protected String doInBackground(Void... params) {
                                final GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(getActivity());
                                String msg = "";
                                try {
                                    Bundle data = new Bundle();
                                    data.putString("message", String.valueOf(message));
                                    String id = UUID.randomUUID().toString();
                                    gcm.send(to + "@gcm.googleapis.com", id, 60000, data);
                                    msg = "Sent message to " + to;
                                } catch (IOException ex) {
                                    msg = "Error :" + ex.getMessage();
                                    progressDialog.dismiss();
                                }
                                return msg;
                            }

                            @Override
                            protected void onPostExecute(String msg) {
                                progressDialog.dismiss();
                                dismiss();
                                Toast.makeText(getActivity(), msg, Toast.LENGTH_LONG).show();
                            }
                        }.execute(null, null, null);
                    }
                })
                .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        dialog.dismiss();
                    }
                });
        return builder.create();
    }
}


text:
package io.cettia.asity.example.echo;

import io.cettia.asity.action.Action;
import io.cettia.asity.http.HttpStatus;
import io.cettia.asity.http.ServerHttpExchange;

/**
 * @author Donghwan Kim
 */
public class HttpEchoServer implements Action<ServerHttpExchange> {
  @Override
  public void on(ServerHttpExchange http) {
    // Reads request URI, method and headers
    System.out.println(http.method() + " " + http.uri());
    http.headerNames().stream().forEach(name -> System.out.println(name + ": " + String.join(", ", http.headers(name))));

    // Writes response status code and headers
    http.setStatus(HttpStatus.OK).setHeader("content-type", http.header("content-type"));

    // Reads a chunk from request body and writes it to response body
    http.onchunk((String chunk) -> http.write(chunk)).readAsText();
    // If request body is binary,
    // http.onchunk((ByteBuffer binary) -> http.write(binary)).readAsBinary();

    // Ends response if request ends
    http.onend((Void v) -> http.end());

    // Exception handling
    http.onerror((Throwable t) -> t.printStackTrace()).onclose((Void v) -> System.out.println("disconnected"));
  }
}


text:
package com.plivo.helper.api.response.number;

import java.util.List;

import com.google.gson.annotations.SerializedName;

public class NumberResponse {
    @SerializedName("numbers")
    public List<NumberStatus> numberStatusList ;

    public String status ;

    public String error ;

    @SerializedName("api_id")
    public String apiId;

    public NumberResponse() {
        // empty
    }

	@Override
	public String toString() {
		return "NumberResponse [numberStatusList=" + numberStatusList
				+ ", status=" + status + ", error=" + error + ", apiId="
				+ apiId + "]";
	}
}


text:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Quasar.HabboHotel.Rooms;
using Quasar.HabboHotel.Items;
using Quasar.Communication.Packets.Outgoing.Inventory.Purse;
using Quasar.Communication.Packets.Outgoing.Inventory.Furni;

using Quasar.Database.Interfaces;

namespace Quasar.Communication.Packets.Incoming.Rooms.Furni
{
    class GetCraftingItemEvent : IPacketEvent
    {
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {

        }
    }
}


text:
namespace Dapper.SimpleSave.Impl
{
    public class Ancestor
    {
        public object OldObject { get; set; }
        public object NewObject { get; set; }
    }
}


text:
require 'test_helper'

module AdMan
  class KeywordsControllerTest < ActionController::TestCase
    setup do
      @keyword = ad_man_keywords(:one)
      @routes = AdMan::Engine.routes
    end

    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:keywords)
    end

    test "should get new" do
      get :new
      assert_response :success
    end

    test "should create keyword" do
      assert_difference('Keyword.count') do
        post :create, keyword: { name: 'RandomName' }
      end
      assert_redirected_to advertisements_path
    end

    test "should show keyword" do
      get :show, id: @keyword
      assert_response :success
    end

    test "should get edit" do
      get :edit, id: @keyword
      assert_response :success
    end

    test "should update keyword" do
      put :update, id: @keyword, keyword: { name: @keyword.name }
      assert_redirected_to advertisements_path
    end

    test "should destroy keyword" do
      assert_difference('Keyword.count', -1) do
        delete :destroy, id: @keyword
      end
      assert_redirected_to advertisements_path
    end
  end
end


text:
using System.Linq;
using System.Text;
using AzureFtpServer.General;
using AzureFtpServer.Ftp;
using AzureFtpServer.Ftp.General;

namespace AzureFtpServer.FtpCommands
{
    /// <summary>
    /// MLSD command handler
    /// only list content under directories
    /// </summary>
    class MlsdCommandHandler : MlsxCommandHandlerBase
    {
        public MlsdCommandHandler(FtpConnectionObject connectionObject)
            : base("MLSD", connectionObject)
        {
        }

        protected override string OnProcess(string sMessage)
        {
            sMessage = sMessage.Trim();

            // Get the dir to list
            string targetToList = GetPath(sMessage);

            // checks the dir name
            if (!FileNameHelpers.IsValid(targetToList))
            {
                return GetMessage(501, $"\"{sMessage}\" is not a valid directory name");
            }

            // specify the directory tag
            targetToList = FileNameHelpers.AppendDirTag(targetToList);

            bool targetIsDir = ConnectionObject.FileSystemObject.DirectoryExists(targetToList);

            if (!targetIsDir)
            {
                return GetMessage(550, $"Directory \"{targetToList}\" not exists");
            }

            #region Generate response

            StringBuilder response = new StringBuilder();

            string[] files = ConnectionObject.FileSystemObject.GetFiles(targetToList);
            string[] directories = ConnectionObject.FileSystemObject.GetDirectories(targetToList);

            if (files != null && files.Any())
            {
                foreach (var file in files)
                {
                    var fileInfo = ConnectionObject.FileSystemObject.GetFileInfo(file);

                    response.Append(GenerateEntry(fileInfo));

                    response.Append("\r\n");
                }
            }

            if (directories != null && directories.Any())
            {
                foreach (var dir in directories)
                {
                    var dirInfo = ConnectionObject.FileSystemObject.GetDirectoryInfo(dir);

                    response.Append(GenerateEntry(dirInfo));

                    response.Append("\r\n");
                }
            }

            #endregion

            #region Write response

            var socketData = new FtpDataSocket(ConnectionObject);

            if (!socketData.Loaded)
            {
                return GetMessage(425, "Unable to establish the data connection");
            }

            SocketHelpers.Send(ConnectionObject.Socket, $"150 {ConnectionObject.DataType} Opening data connection for MLSD {targetToList}\r\n", ConnectionObject.Encoding);

            try
            {
                // ToDo, send response according to ConnectionObject.DataType, i.e., Ascii or Binary
                socketData.Send(response.ToString(), ConnectionObject.Encoding);
            }
            finally
            {
                socketData.Close();
            }

            #endregion

            return GetMessage(226, "MLSD successful");
        }
    }
}


text:
.class Landroid/media/MiniThumbFile$MiniThumbDataFile;
.super Ljava/lang/Object;
.source "MiniThumbFile.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/media/MiniThumbFile;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "MiniThumbDataFile"
.end annotation

# instance fields
.field private mActiveCount:I

.field private mChannel:Ljava/nio/channels/FileChannel;

.field private mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

.field private mPath:Ljava/lang/String;

.field private mRandomAccessFile:Ljava/io/RandomAccessFile;

.field final synthetic this$0:Landroid/media/MiniThumbFile;

# direct methods
.method public constructor <init>(Landroid/media/MiniThumbFile;Ljava/io/RandomAccessFile;Ljava/lang/String;)V
    .locals 8
    .param p2, "miniThumbFile"    # Ljava/io/RandomAccessFile;
    .param p3, "path"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 368
    iput-object p1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 369
    iput-object p2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    .line 370
    iput-object p3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mPath:Ljava/lang/String;

    .line 372
    invoke-direct {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->load()Z

    move-result v0

    if-nez v0, :cond_0

    .line 373
    invoke-direct {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->reset()V

    .line 378
    :cond_0
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    invoke-virtual {v0}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;

    move-result-object v0

    iput-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    .line 380
    :try_start_0
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    sget-object v1, Ljava/nio/channels/FileChannel$MapMode;->READ_WRITE:Ljava/nio/channels/FileChannel$MapMode;

    const-wide/16 v2, 0x0

    const-wide/32 v4, 0x80000

    invoke-virtual/range {v0 .. v5}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;

    move-result-object v0

    iput-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;
    :try_end_0
    .catch Ljava/nio/channels/NonWritableChannelException; {:try_start_0 .. :try_end_0} :catch_0

    .line 389
    :goto_0
    const-string v0, "MiniThumbFile"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Create MiniThumbDataFile with size "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    invoke-virtual {v2}, Ljava/io/RandomAccessFile;->length()J

    move-result-wide v2

    const-wide/16 v4, 0x400

    div-long/2addr v2, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "KB"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 390
    return-void

    .line 381
    :catch_0
    move-exception v6

    .line 382
    .local v6, "ex1":Ljava/nio/channels/NonWritableChannelException;
    const-string v0, "MiniThumbFile"

    const-string/jumbo v1, "map MiniThumbFile(READ_WRITE) with NonWritableChannelException, try READ_ONLY mode"

    invoke-static {v0, v1, v6}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 384
    :try_start_1
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    sget-object v1, Ljava/nio/channels/FileChannel$MapMode;->READ_ONLY:Ljava/nio/channels/FileChannel$MapMode;

    const-wide/16 v2, 0x0

    const-wide/32 v4, 0x80000

    invoke-virtual/range {v0 .. v5}, Ljava/nio/channels/FileChannel;->map(Ljava/nio/channels/FileChannel$MapMode;JJ)Ljava/nio/MappedByteBuffer;

    move-result-object v0

    iput-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;
    :try_end_1
    .catch Ljava/nio/channels/NonReadableChannelException; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_0

    .line 385
    :catch_1
    move-exception v7

    .line 386
    .local v7, "ex2":Ljava/nio/channels/NonReadableChannelException;
    new-instance v0, Ljava/io/IOException;

    const-string/jumbo v1, "try map as READ_ONLY mode with NonReadableChannelException"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method private declared-synchronized load()Z
    .locals 10
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const/4 v2, 0x0

    .line 394
    monitor-enter p0

    :try_start_0
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    const-wide/16 v4, 0x0

    invoke-virtual {v3, v4, v5}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 395
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/io/RandomAccessFile;->read([B)I

    move-result v3

    const/16 v4, 0x20

    if-eq v3, v4, :cond_0

    .line 396
    const-string v3, "MiniThumbFile"

    const-string v4, "cannot read version header"

    invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 426
    :goto_0
    monitor-exit p0

    return v2

    .line 400
    :cond_0
    :try_start_1
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    const/4 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v3

    const/4 v4, 0x6

    if-eq v3, v4, :cond_1

    .line 401
    const-string v3, "MiniThumbFile"

    const-string/jumbo v4, "miss MiniThumbDataFile version"

    invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 394
    :catchall_0
    move-exception v2

    monitor-exit p0

    throw v2

    .line 405
    :cond_1
    :try_start_2
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    const/4 v5, 0x4

    invoke-static {v3, v4, v5}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v4

    const-wide/32 v6, 0x20140218

    cmp-long v3, v4, v6

    if-eqz v3, :cond_2

    .line 406
    const-string v3, "MiniThumbFile"

    const-string/jumbo v4, "miss MiniThumbDataFile magic"

    invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 410
    :cond_2
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    const/16 v5, 0xc

    invoke-static {v3, v4, v5}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v3

    iput v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I

    const/16 v4, 0x3fff

    if-lt v3, v4, :cond_3

    .line 411
    const-string v3, "MiniThumbFile"

    const-string v4, "active count big than limit, need reset"

    invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 415
    :cond_3
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    const/16 v5, 0x18

    invoke-static {v3, v4, v5}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v4

    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v6, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v6

    const/4 v7, 0x0

    const/16 v8, 0x18

    invoke-static {v3, v6, v7, v8}, Landroid/media/MiniThumbFile;->access$300(Landroid/media/MiniThumbFile;[BII)J

    move-result-wide v6

    cmp-long v3, v4, v6

    if-eqz v3, :cond_4

    .line 416
    const-string v3, "MiniThumbFile"

    const-string v4, "invalid version check sum, version header may be destoried"

    invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 420
    :cond_4
    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    invoke-virtual {v3}, Ljava/io/RandomAccessFile;->length()J

    move-result-wide v0

    .line 421
    .local v0, "size":J
    const-wide/32 v4, 0x3200000

    cmp-long v3, v0, v4

    if-lez v3, :cond_5

    .line 422
    const-string v3, "MiniThumbFile"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "MiniThumbDataFile size is big than limit(current size = "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-wide/16 v6, 0x400

    div-long v6, v0, v6

    const-wide/16 v8, 0x400

    div-long/2addr v6, v8

    invoke-virtual {v4, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "M)"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 425
    :cond_5
    const-string v2, "MiniThumbFile"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "load MiniThumbDataFile with active count is "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 426
    const/4 v2, 0x1

    goto/16 :goto_0
.end method

.method private declared-synchronized reset()V
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 430
    monitor-enter p0

    :try_start_0
    const-string v0, "MiniThumbFile"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "reset MiniThumbDataFile "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mPath:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 431
    const/4 v0, 0x0

    iput v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I

    .line 433
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    const-wide/16 v2, 0x0

    invoke-virtual {v0, v2, v3}, Ljava/io/RandomAccessFile;->setLength(J)V

    .line 434
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    const-wide/32 v2, 0x80000

    invoke-virtual {v0, v2, v3}, Ljava/io/RandomAccessFile;->setLength(J)V

    .line 436
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    const-wide/16 v2, 0x0

    invoke-virtual {v0, v2, v3}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 437
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/4 v2, 0x0

    const/4 v3, 0x6

    invoke-static {v0, v1, v2, v3}, Landroid/media/MiniThumbFile;->access$400(Landroid/media/MiniThumbFile;[BII)V

    .line 438
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/4 v2, 0x4

    const-wide/32 v4, 0x20140218

    invoke-static {v0, v1, v2, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 439
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/16 v2, 0xc

    iget v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I

    invoke-static {v0, v1, v2, v3}, Landroid/media/MiniThumbFile;->access$400(Landroid/media/MiniThumbFile;[BII)V

    .line 440
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/16 v2, 0x10

    const-wide/32 v4, -0x3f113e2b

    invoke-static {v0, v1, v2, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 441
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/16 v2, 0x18

    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    const/4 v5, 0x0

    const/16 v6, 0x18

    invoke-static {v3, v4, v5, v6}, Landroid/media/MiniThumbFile;->access$300(Landroid/media/MiniThumbFile;[BII)J

    move-result-wide v4

    invoke-static {v0, v1, v2, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 442
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/io/RandomAccessFile;->write([B)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 443
    monitor-exit p0

    return-void

    .line 430
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

# virtual methods
.method public bufferToString([B)Ljava/lang/String;
    .locals 4
    .param p1, "buffer"    # [B

    .prologue
    .line 616
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 617
    .local v0, "builder":Ljava/lang/StringBuilder;
    const-string v1, "id = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    const/4 v3, 0x0

    invoke-static {v2, p1, v3}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    .line 618
    const-string v1, ", magic = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    const/16 v3, 0x8

    invoke-static {v2, p1, v3}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    .line 619
    const-string v1, ", data checksum = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    const/16 v3, 0x10

    invoke-static {v2, p1, v3}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    .line 620
    const-string v1, ", position = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    const/16 v3, 0x18

    invoke-static {v2, p1, v3}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    .line 621
    const-string v1, ", length = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    const/16 v3, 0x1c

    invoke-static {v2, p1, v3}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    .line 622
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method

.method public declared-synchronized close()V
    .locals 3

    .prologue
    .line 589
    monitor-enter p0

    :try_start_0
    const-string v0, "MiniThumbFile"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "close MiniThumbDataFile "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mPath:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 590
    invoke-virtual {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->syncAll()V

    .line 591
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    invoke-static {v0}, Llibcore/io/IoUtils;->closeQuietly(Ljava/lang/AutoCloseable;)V

    .line 592
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    invoke-static {v0}, Llibcore/io/IoUtils;->closeQuietly(Ljava/lang/AutoCloseable;)V

    .line 593
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    .line 594
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    .line 595
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 596
    monitor-exit p0

    return-void

    .line 589
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized getActiveCount()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 458
    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;

    .line 459
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/nio/MappedByteBuffer;->get([B)Ljava/nio/ByteBuffer;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/16 v2, 0x18

    invoke-static {v0, v1, v2}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v0

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v3}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v3

    const/4 v4, 0x0

    const/16 v5, 0x18

    invoke-static {v2, v3, v4, v5}, Landroid/media/MiniThumbFile;->access$300(Landroid/media/MiniThumbFile;[BII)J

    move-result-wide v2

    cmp-long v0, v0, v2

    if-nez v0, :cond_0

    .line 461
    iget-object v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    const/16 v2, 0xc

    invoke-static {v0, v1, v2}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v0

    iput v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I

    .line 462
    const-string v0, "MiniThumbFile"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "getActiveCount is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 463
    iget v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 467
    :goto_0
    monitor-exit p0

    return v0

    .line 465
    :cond_0
    :try_start_1
    const-string v0, "MiniThumbFile"

    const-string v1, "invalid version header, reset MiniThumbDataFile"

    invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 466
    invoke-direct {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->reset()V

    .line 467
    iget v0, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mActiveCount:I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 458
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized getDataFromThumbFile([BJLandroid/media/MiniThumbFile$ThumbResult;)[B
    .locals 20
    .param p1, "data"    # [B
    .param p2, "id"    # J
    .param p4, "result"    # Landroid/media/MiniThumbFile$ThumbResult;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 537
    monitor-enter p0

    :try_start_0
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v5

    move-object/from16 v0, p0

    move-wide/from16 v1, p2

    invoke-virtual {v0, v5, v1, v2}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->getIndexHeader([BJ)Ljava/nio/ByteBuffer;

    move-result-object v5

    if-nez v5, :cond_1

    .line 538
    const-string v5, "MiniThumbFile"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "can not get index header for id "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-wide/from16 v0, p2

    invoke-virtual {v6, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 539
    const/16 p1, 0x0

    .line 585
    .end local p1    # "data":[B
    :cond_0
    :goto_0
    monitor-exit p0

    return-object p1

    .line 542
    .restart local p1    # "data":[B
    :cond_1
    :try_start_1
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v6

    const/4 v7, 0x0

    invoke-static {v5, v6, v7}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v18

    .line 543
    .local v18, "oldId":J
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v6

    const/16 v7, 0x8

    invoke-static {v5, v6, v7}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v16

    .line 544
    .local v16, "magic":J
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v6

    const/16 v7, 0x10

    invoke-static {v5, v6, v7}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v12

    .line 545
    .local v12, "dataCheckSum":J
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v6

    const/16 v7, 0x18

    invoke-static {v5, v6, v7}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v15

    .line 546
    .local v15, "position":I
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v6

    const/16 v7, 0x1c

    invoke-static {v5, v6, v7}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v11

    .line 548
    .local v11, "length":I
    cmp-long v5, v18, p2

    if-eqz v5, :cond_2

    .line 549
    const-string v5, "MiniThumbFile"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "invalid store original id : store id = "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-wide/from16 v0, v18

    invoke-virtual {v6, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ", given id = "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-wide/from16 v0, p2

    invoke-virtual {v6, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 550
    const/16 p1, 0x0

    goto/16 :goto_0

    .line 552
    :cond_2
    move-object/from16 v0, p1

    array-length v5, v0

    if-ge v5, v11, :cond_3

    .line 553
    const-string v5, "MiniThumbFile"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "invalid store data length: store length = "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ", given length = "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-object/from16 v0, p1

    array-length v7, v0

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 554
    const/16 p1, 0x0

    goto/16 :goto_0

    .line 557
    :cond_3
    const/4 v14, 0x0

    .line 559
    .local v14, "lock":Ljava/nio/channels/FileLock;
    :try_start_2
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 560
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    int-to-long v6, v15

    const-wide/16 v8, 0x4000

    const/4 v10, 0x0

    invoke-virtual/range {v5 .. v10}, Ljava/nio/channels/FileChannel;->lock(JJZ)Ljava/nio/channels/FileLock;

    move-result-object v14

    .line 561
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v6}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v6

    int-to-long v8, v15

    invoke-virtual {v5, v6, v8, v9}, Ljava/nio/channels/FileChannel;->read(Ljava/nio/ByteBuffer;J)I

    move-result v5

    if-lt v5, v11, :cond_6

    .line 562
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v5

    const/4 v6, 0x0

    invoke-virtual {v5, v6}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    .line 563
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v5

    const/4 v6, 0x0

    move-object/from16 v0, p1

    invoke-virtual {v5, v0, v6, v11}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;

    .line 564
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    const/4 v6, 0x0

    move-object/from16 v0, p1

    invoke-static {v5, v0, v6, v11}, Landroid/media/MiniThumbFile;->access$300(Landroid/media/MiniThumbFile;[BII)J

    move-result-wide v6

    cmp-long v5, v12, v6

    if-nez v5, :cond_5

    .line 565
    if-eqz p4, :cond_4

    .line 566
    const/4 v5, 0x2

    move-object/from16 v0, p4

    invoke-virtual {v0, v5}, Landroid/media/MiniThumbFile$ThumbResult;->setDetail(I)V

    .line 568
    :cond_4
    const-string v5, "MiniThumbFile"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "getDataFromThumbFile success with "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-object/from16 v0, p0

    iget-object v7, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v7}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v7

    move-object/from16 v0, p0

    invoke-virtual {v0, v7}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->bufferToString([B)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    .line 578
    if-eqz v14, :cond_0

    .line 579
    :try_start_3
    invoke-virtual {v14}, Ljava/nio/channels/FileLock;->release()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto/16 :goto_0

    .line 580
    :catch_0
    move-exception v4

    .line 581
    .local v4, "ex":Ljava/io/IOException;
    :try_start_4
    const-string v5, "MiniThumbFile"

    const-string v6, "getDataFromThumbFile: can not release lock!"

    invoke-static {v5, v6, v4}, Lcom/mediatek/xlog/Xlog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    goto/16 :goto_0

    .line 537
    .end local v4    # "ex":Ljava/io/IOException;
    .end local v11    # "length":I
    .end local v12    # "dataCheckSum":J
    .end local v14    # "lock":Ljava/nio/channels/FileLock;
    .end local v15    # "position":I
    .end local v16    # "magic":J
    .end local v18    # "oldId":J
    :catchall_0
    move-exception v5

    monitor-exit p0

    throw v5

    .line 571
    .restart local v11    # "length":I
    .restart local v12    # "dataCheckSum":J
    .restart local v14    # "lock":Ljava/nio/channels/FileLock;
    .restart local v15    # "position":I
    .restart local v16    # "magic":J
    .restart local v18    # "oldId":J
    :cond_5
    if-eqz p4, :cond_6

    .line 572
    const/4 v5, 0x1

    :try_start_5
    move-object/from16 v0, p4

    invoke-virtual {v0, v5}, Landroid/media/MiniThumbFile$ThumbResult;->setDetail(I)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_1

    .line 578
    :cond_6
    if-eqz v14, :cond_7

    .line 579
    :try_start_6
    invoke-virtual {v14}, Ljava/nio/channels/FileLock;->release()V
    :try_end_6
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1
    .catchall {:try_start_6 .. :try_end_6} :catchall_0

    .line 584
    :cond_7
    :goto_1
    :try_start_7
    const-string v5, "MiniThumbFile"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "getDataFromThumbFile fail with "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-object/from16 v0, p0

    iget-object v7, v0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v7}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v7

    move-object/from16 v0, p0

    invoke-virtual {v0, v7}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->bufferToString([B)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 585
    const/16 p1, 0x0

    goto/16 :goto_0

    .line 580
    :catch_1
    move-exception v4

    .line 581
    .restart local v4    # "ex":Ljava/io/IOException;
    const-string v5, "MiniThumbFile"

    const-string v6, "getDataFromThumbFile: can not release lock!"

    invoke-static {v5, v6, v4}, Lcom/mediatek/xlog/Xlog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_0

    goto :goto_1

    .line 577
    .end local v4    # "ex":Ljava/io/IOException;
    :catchall_1
    move-exception v5

    .line 578
    if-eqz v14, :cond_8

    .line 579
    :try_start_8
    invoke-virtual {v14}, Ljava/nio/channels/FileLock;->release()V
    :try_end_8
    .catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_2
    .catchall {:try_start_8 .. :try_end_8} :catchall_0

    .line 582
    :cond_8
    :goto_2
    :try_start_9
    throw v5

    .line 580
    :catch_2
    move-exception v4

    .line 581
    .restart local v4    # "ex":Ljava/io/IOException;
    const-string v6, "MiniThumbFile"

    const-string v7, "getDataFromThumbFile: can not release lock!"

    invoke-static {v6, v7, v4}, Lcom/mediatek/xlog/Xlog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_9
    .catchall {:try_start_9 .. :try_end_9} :catchall_0

    goto :goto_2
.end method

.method public declared-synchronized getIndexHeader([BJ)Ljava/nio/ByteBuffer;
    .locals 4
    .param p1, "header"    # [B
    .param p2, "id"    # J
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 477
    monitor-enter p0

    long-to-int v1, p2

    :try_start_0
    rem-int/lit16 v1, v1, 0x3fff

    mul-int/lit8 v1, v1, 0x20

    add-int/lit8 v0, v1, 0x20

    .line 478
    .local v0, "position":I
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    invoke-virtual {v1, v0}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;

    .line 479
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    const/4 v2, 0x0

    const/16 v3, 0x20

    invoke-virtual {v1, p1, v2, v3}, Ljava/nio/MappedByteBuffer;->get([BII)Ljava/nio/ByteBuffer;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v1

    monitor-exit p0

    return-object v1

    .line 477
    .end local v0    # "position":I
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1
.end method

.method public declared-synchronized getMagic(J)J
    .locals 7
    .param p1, "id"    # J
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 483
    monitor-enter p0

    :try_start_0
    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v4

    invoke-virtual {p0, v4, p1, p2}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->getIndexHeader([BJ)Ljava/nio/ByteBuffer;

    .line 484
    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v5, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v5

    const/4 v6, 0x0

    invoke-static {v4, v5, v6}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v2

    .line 485
    .local v2, "storedId":J
    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v5, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v5

    const/16 v6, 0x8

    invoke-static {v4, v5, v6}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v0

    .line 486
    .local v0, "magic":J
    cmp-long v4, v2, p1

    if-nez v4, :cond_0

    .line 487
    const-string v4, "MiniThumbFile"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "getMagic succuss with: id = "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ", magic = "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 491
    .end local v0    # "magic":J
    :goto_0
    monitor-exit p0

    return-wide v0

    .line 490
    .restart local v0    # "magic":J
    :cond_0
    :try_start_1
    const-string v4, "MiniThumbFile"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "getMagic fail for id "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " with store id is "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 491
    const-wide/16 v0, 0x0

    goto :goto_0

    .line 483
    .end local v0    # "magic":J
    .end local v2    # "storedId":J
    :catchall_0
    move-exception v4

    monitor-exit p0

    throw v4
.end method

.method public syncAll()V
    .locals 3

    .prologue
    .line 607
    invoke-virtual {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->syncIndex()V

    .line 609
    :try_start_0
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mRandomAccessFile:Ljava/io/RandomAccessFile;

    invoke-virtual {v1}, Ljava/io/RandomAccessFile;->getFD()Ljava/io/FileDescriptor;

    move-result-object v1

    invoke-virtual {v1}, Ljava/io/FileDescriptor;->sync()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    .line 613
    :goto_0
    return-void

    .line 610
    :catch_0
    move-exception v0

    .line 611
    .local v0, "t":Ljava/lang/Throwable;
    const-string v1, "MiniThumbFile"

    const-string/jumbo v2, "sync MiniThumbDataFile failed"

    invoke-static {v1, v2, v0}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public syncIndex()V
    .locals 3

    .prologue
    .line 600
    :try_start_0
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    invoke-virtual {v1}, Ljava/nio/MappedByteBuffer;->force()Ljava/nio/MappedByteBuffer;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    .line 604
    :goto_0
    return-void

    .line 601
    :catch_0
    move-exception v0

    .line 602
    .local v0, "t":Ljava/lang/Throwable;
    const-string v1, "MiniThumbFile"

    const-string/jumbo v2, "sync MiniThumbDataFile index failed"

    invoke-static {v1, v2, v0}, Lcom/mediatek/xlog/Xlog;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public declared-synchronized updateActiveCount()I
    .locals 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 446
    monitor-enter p0

    :try_start_0
    invoke-virtual {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->getActiveCount()I

    move-result v0

    .line 447
    .local v0, "currentActionCount":I
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/4 v3, 0x0

    const/4 v4, 0x6

    invoke-static {v1, v2, v3, v4}, Landroid/media/MiniThumbFile;->access$400(Landroid/media/MiniThumbFile;[BII)V

    .line 448
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/4 v3, 0x4

    const-wide/32 v4, 0x20140218

    invoke-static {v1, v2, v3, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 449
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0xc

    add-int/lit8 v0, v0, 0x1

    invoke-static {v1, v2, v3, v0}, Landroid/media/MiniThumbFile;->access$400(Landroid/media/MiniThumbFile;[BII)V

    .line 450
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x10

    const-wide/32 v4, -0x3f113e2b

    invoke-static {v1, v2, v3, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 451
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x18

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v5, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v5}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v5

    const/4 v6, 0x0

    const/16 v7, 0x18

    invoke-static {v4, v5, v6, v7}, Landroid/media/MiniThumbFile;->access$300(Landroid/media/MiniThumbFile;[BII)J

    move-result-wide v4

    invoke-static {v1, v2, v3, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 452
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;

    .line 453
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$000(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/nio/MappedByteBuffer;->put([B)Ljava/nio/ByteBuffer;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 454
    monitor-exit p0

    return v0

    .line 446
    .end local v0    # "currentActionCount":I
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1
.end method

.method public declared-synchronized updateDataToThumbFile([BJJ)V
    .locals 10
    .param p1, "data"    # [B
    .param p2, "id"    # J
    .param p4, "magic"    # J
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 496
    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    array-length v1, p1

    const/16 v2, 0x4000

    if-le v1, v2, :cond_1

    .line 497
    :cond_0
    const-string v1, "MiniThumbFile"

    const-string/jumbo v2, "updateDataToThumbFile with invalid data"

    invoke-static {v1, v2}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 534
    :goto_0
    monitor-exit p0

    return-void

    .line 502
    :cond_1
    const/4 v8, 0x0

    .line 503
    .local v8, "position":I
    :try_start_1
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    invoke-virtual {p0, v1, p2, p3}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->getIndexHeader([BJ)Ljava/nio/ByteBuffer;

    move-result-object v1

    if-eqz v1, :cond_3

    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/media/MiniThumbFile;->access$200(Landroid/media/MiniThumbFile;[BI)J

    move-result-wide v2

    cmp-long v1, v2, p2

    if-nez v1, :cond_3

    .line 505
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x18

    invoke-static {v1, v2, v3}, Landroid/media/MiniThumbFile;->access$100(Landroid/media/MiniThumbFile;[BI)I

    move-result v8

    .line 511
    :goto_1
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/4 v3, 0x0

    invoke-static {v1, v2, v3, p2, p3}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 512
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x8

    invoke-static {v1, v2, v3, p4, p5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 513
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x10

    iget-object v4, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v4, p1}, Landroid/media/MiniThumbFile;->access$700(Landroid/media/MiniThumbFile;[B)J

    move-result-wide v4

    invoke-static {v1, v2, v3, v4, v5}, Landroid/media/MiniThumbFile;->access$500(Landroid/media/MiniThumbFile;[BIJ)V

    .line 514
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x18

    invoke-static {v1, v2, v3, v8}, Landroid/media/MiniThumbFile;->access$400(Landroid/media/MiniThumbFile;[BII)V

    .line 515
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v2

    const/16 v3, 0x1c

    array-length v4, p1

    invoke-static {v1, v2, v3, v4}, Landroid/media/MiniThumbFile;->access$400(Landroid/media/MiniThumbFile;[BII)V

    .line 516
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v1

    invoke-virtual {p0, v1, p2, p3}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->updateIndexHeader([BJ)V

    .line 518
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 519
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    .line 520
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v1}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 521
    const/4 v7, 0x0

    .line 523
    .local v7, "lock":Ljava/nio/channels/FileLock;
    :try_start_2
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    int-to-long v2, v8

    const-wide/16 v4, 0x4000

    const/4 v6, 0x0

    invoke-virtual/range {v1 .. v6}, Ljava/nio/channels/FileChannel;->lock(JJZ)Ljava/nio/channels/FileLock;

    move-result-object v7

    .line 524
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mChannel:Ljava/nio/channels/FileChannel;

    iget-object v2, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v2}, Landroid/media/MiniThumbFile;->access$800(Landroid/media/MiniThumbFile;)Ljava/nio/ByteBuffer;

    move-result-object v2

    int-to-long v4, v8

    invoke-virtual {v1, v2, v4, v5}, Ljava/nio/channels/FileChannel;->write(Ljava/nio/ByteBuffer;J)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    .line 527
    if-eqz v7, :cond_2

    .line 528
    :try_start_3
    invoke-virtual {v7}, Ljava/nio/channels/FileLock;->release()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 533
    :cond_2
    :goto_2
    :try_start_4
    const-string v1, "MiniThumbFile"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "updateDataToThumbFile succuss with "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->this$0:Landroid/media/MiniThumbFile;

    invoke-static {v3}, Landroid/media/MiniThumbFile;->access$600(Landroid/media/MiniThumbFile;)[B

    move-result-object v3

    invoke-virtual {p0, v3}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->bufferToString([B)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/mediatek/xlog/Xlog;->v(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    goto/16 :goto_0

    .line 496
    .end local v7    # "lock":Ljava/nio/channels/FileLock;
    .end local v8    # "position":I
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1

    .line 508
    .restart local v8    # "position":I
    :cond_3
    const/high16 v1, 0x80000

    :try_start_5
    invoke-virtual {p0}, Landroid/media/MiniThumbFile$MiniThumbDataFile;->updateActiveCount()I

    move-result v2

    mul-int/lit16 v2, v2, 0x4000

    add-int v8, v1, v2

    goto/16 :goto_1

    .line 529
    .restart local v7    # "lock":Ljava/nio/channels/FileLock;
    :catch_0
    move-exception v0

    .line 530
    .local v0, "ex":Ljava/io/IOException;
    const-string v1, "MiniThumbFile"

    const-string/jumbo v2, "updateDataToThumbFile: can not release lock!"

    invoke-static {v1, v2, v0}, Lcom/mediatek/xlog/Xlog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    goto :goto_2

    .line 526
    .end local v0    # "ex":Ljava/io/IOException;
    :catchall_1
    move-exception v1

    .line 527
    if-eqz v7, :cond_4

    .line 528
    :try_start_6
    invoke-virtual {v7}, Ljava/nio/channels/FileLock;->release()V
    :try_end_6
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1
    .catchall {:try_start_6 .. :try_end_6} :catchall_0

    .line 531
    :cond_4
    :goto_3
    :try_start_7
    throw v1

    .line 529
    :catch_1
    move-exception v0

    .line 530
    .restart local v0    # "ex":Ljava/io/IOException;
    const-string v2, "MiniThumbFile"

    const-string/jumbo v3, "updateDataToThumbFile: can not release lock!"

    invoke-static {v2, v3, v0}, Lcom/mediatek/xlog/Xlog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_0

    goto :goto_3
.end method

.method public declared-synchronized updateIndexHeader([BJ)V
    .locals 4
    .param p1, "header"    # [B
    .param p2, "id"    # J
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 471
    monitor-enter p0

    long-to-int v1, p2

    :try_start_0
    rem-int/lit16 v1, v1, 0x3fff

    mul-int/lit8 v1, v1, 0x20

    add-int/lit8 v0, v1, 0x20

    .line 472
    .local v0, "position":I
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    invoke-virtual {v1, v0}, Ljava/nio/MappedByteBuffer;->position(I)Ljava/nio/Buffer;

    .line 473
    iget-object v1, p0, Landroid/media/MiniThumbFile$MiniThumbDataFile;->mIndexMappedBuffer:Ljava/nio/MappedByteBuffer;

    const/4 v2, 0x0

    const/16 v3, 0x20

    invoke-virtual {v1, p1, v2, v3}, Ljava/nio/MappedByteBuffer;->put([BII)Ljava/nio/ByteBuffer;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 474
    monitor-exit p0

    return-void

    .line 471
    .end local v0    # "position":I
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1
.end method


text: Bookmarklet: Shell


text:
<?php

namespace App;

define(__NAMESPACE__ . '\GOOGLE_API_KEY', 'google-api-key');

add_action('acf/init', function(){
  acf_update_setting('google_api_key', GOOGLE_API_KEY);
});

function geocoded_address_components($address) {
	$encoded_address = urlencode($address);
	$url = "https://maps.googleapis.com/maps/api/geocode/json?address={$encoded_address}&key=" . GOOGLE_API_KEY;
	$response = @file_get_contents($url);
	$json = json_decode($response, true);
	if ($json['status'] === 'OK') {
    $address_components = $json['results'][0]['address_components'];
		$components = array();
		foreach ($address_components as $component) {
			if ($component['types'][0] === 'country') {
				$components['country_abbr'] = $component['short_name'];
			}
			$components[$component['types'][0]] = $component['long_name'];
		}
		$components['street_address'] = "{$components['street_number']} {$components['route']}";
		return $components;
	}
  return null;
}

add_action( 'acf/save_post', function($post_id) {
	if (empty($_POST['acf']['field_5aa6eb8db86b3']['address'])) {
    return;
  }
	$address_components = geocoded_address_components($_POST['acf']['field_5aa6eb8db86b3']['address']);
	if (!empty($address_components)) {
    $address_field_keys = array(
      'street_address' => 'field_5aa6f7cc433ba',
      'locality' => 'field_5aa6f889433bf',
      'administrative_area_level_1' => 'field_5aa6f895433c0',
      'postal_code' => 'field_5aa6f8a5433c1',
      'country' => 'field_5aa6f8b0433c2',
      'country_abbr' => 'field_5aa6f8c5433c3',
    );
    foreach ($address_field_keys as $component_key => $acf_key) {
			$_POST['acf'][$acf_key] = $address_components[$component_key];
    }
  }
}, 1, 1);


text:
package com.magento.idea.magento2plugin.xml.di.reference.provider.resolver;

import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlElement;
import com.intellij.psi.xml.XmlTag;
import org.jetbrains.annotations.Nullable;

/**
 * Created by dkvashnin on 10/19/15.
 */
public abstract class ClassNameResolver {

    public XmlTag findTypeTag(PsiElement psiElement) {
        if (psiElement instanceof XmlTag && ((XmlTag) psiElement).getName().equals(getTagName())) {
            return (XmlTag) psiElement;
        }

        if (psiElement.getParent() == null || !(psiElement.getParent() instanceof XmlElement)) {
            return null;
        }

        return findTypeTag(psiElement.getParent());
    }

    @Nullable
    abstract public String resolveTypeName(XmlTag xmlTag);

    abstract protected String getTagName();
}


text:
import { fn as libfn } from './lib2.js';

export function fn () {
  libfn();
  console.log('dep2 fn');
}


text:
The Godot XRApp framework provides the ability to turn regular Android apps into Quest VR apps!

It unlocks a new and diverse set of VR apps that can be created by leveraging
Android developers tools as well as existing Android UI code and libraries.

![Screenshot showing XRUAMP's phone UI for browsing albums and songs](../../../docs/imgs/1-browse-albums-screenshot.png "Browse albums screenshot")
![Screenshot showing XRUAMP's VR UI for browsing albums and songs](../../../docs/imgs/3-quest-browse-albums-screenshot.jpg "Browse albums VR screenshot")

## License

The framework is released under the MIT license.

## Usage

The Godot XRApp framework can be integrated within an existing code base in three steps:

1. Add the framework dependencies
   - Within the app `build.gradle` file, add the following dependencies:
    ```
    implementation "io.github.m4gr3d:godot:3.4.4.stable"
    implementation "io.github.m4gr3d:godot-openxr:1.3.0.beta5"
    implementation "io.github.m4gr3d:gast-xrapp:0.2.0"
    ```
   - The framework is built atop [`AppCompatActivity`](https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity)
     , so include the appcompat dependency if you don't have it already
    ```
    implementation 'androidx.appcompat:appcompat:1.3.1'
    ```

1. Update the app's main activity
    - Have the app's main activity extend `org.godotengine.plugin.gast.xrapp.GastActivity`
    - Overrides the `isXREnabled()` method and return `true`
        - As its name implies, this method can be used to enable / disable XR integration.

1. Update the app's `AndroidManifest.xml` file to comply with the requirements for running on Quest
    - Add the following to the main activity's `intent-filter`:
      ```
      <category android:name="com.oculus.intent.category.VR" />
      ```
    - The framework is built atop [`AppCompatActivity`](https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity)
      , so specify an appcompat theme in the `<application>` or main `<activity>` tag if you
      don't have one already. E.g:
      ```
      android:theme="@style/Theme.AppCompat.Light.NoActionBar"
      ```

That's all! Your app should now build and run on the Quest as a VR app.

Feel free to take a look at the [samples](../../../samples/xrapp) directory and the [XR
Universal Android Music Player Sample](https://github.com/m4gr3d/xruamp) for examples.

### Current Limitations

- No access to Google Play Services: The Quest platform doesn't have Google Play Services. If
  your app uses one or multiple Google Play Services APIs, it won't be able to run on the
  device.
- No support for [SurfaceView](https://developer.android.com/reference/android/view/SurfaceView)
  , [TextureView](https://developer.android.com/reference/android/view/TextureView) and their
  derivatives.
    - This means functionality like video playback are not available yet.
    - Video playback support will be enabled in future releases.
- For any other issues, please [open a github issue](https://github.com/m4gr3d/GAST/issues) with
  the [`xrapp` label](https://github.com/m4gr3d/GAST/labels/xrapp).

## Additional Features

### Use the same code for regular and VR builds

By switching `GastActivity#isXREnabled()`'s return value, you can use the same code base to
generate a regular Android app and a Quest VR app.

You can see an example of this approach in the [XR Universal Android Music Player Sample](https://github.com/m4gr3d/xruamp)
which uses [Android product
flavors](https://developer.android.com/studio/build/build-variants#product-flavors) to customize
the generated builds.

### Available passthrough environment

The framework provides the ability to toggle
[passthrough](https://support.oculus.com/articles/in-vr-experiences/oculus-features/what-is-passthrough/)
on the Quest, enabling the user access to your app while interacting with their real-time
surroundings:

- Use `GastActivity#startPassthrough()` to start passthrough
- Use `GastActivity#stopPassthrough()` to disable passthrough

You can see an example of that functionality in the [hello_vr_world](../../../samples/xrapp/hello_vr_world)
sample.

### Automatic support for hand tracking

The framework has built-in support for hand tracking, enabling access to your app without the
needs for controllers.

### Oculus Keyboard support

The framework has built-in support for the Oculus Keyboard for input.

## [Roadmap](ROADMAP.md)

## [Contributions](../../../README.md#contributions)


text:
package io.rsocket.frame;

import io.netty.buffer.ByteBuf;
import io.rsocket.FrameType;

public class RequestNFrameFlyweight {
    private RequestNFrameFlyweight() {}

    // relative to start of passed offset
    private static final int REQUEST_N_FIELD_OFFSET = FrameHeaderFlyweight.FRAME_HEADER_LENGTH;

    public static int computeFrameLength() {
        int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.REQUEST_N, 0, 0);

        return length + Integer.BYTES;
    }

    public static int encode(
        final ByteBuf byteBuf,
        final int streamId,
        final int requestN
    ) {
        final int frameLength = computeFrameLength();

        int length = FrameHeaderFlyweight.encodeFrameHeader(byteBuf, frameLength, 0, FrameType.REQUEST_N, streamId);

        byteBuf.setInt(REQUEST_N_FIELD_OFFSET, requestN);

        return length + Integer.BYTES;
    }

    public static int requestN(final ByteBuf byteBuf) {
        return byteBuf.getInt(REQUEST_N_FIELD_OFFSET);
    }

    public static int payloadOffset(final ByteBuf byteBuf) {
        return FrameHeaderFlyweight.FRAME_HEADER_LENGTH + Integer.BYTES;
    }
}