Skip to content

Commit

Permalink
Replace the deprecated IOUtils.toByteArray with readBytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdunn committed Aug 8, 2024
1 parent cf021eb commit 220109a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
/*
* Copyright (C) 2016, 2018-2021 Reece H. Dunn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright (C) 2016-2024 Reece H. Dunn. SPDX-License-Identifier: Apache-2.0
package uk.co.reecedunn.intellij.plugin.core.vfs.impl

import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileSystem
import org.apache.commons.compress.utils.IOUtils
import uk.co.reecedunn.intellij.plugin.core.vfs.ResourceVirtualFile
import java.io.*

Expand Down Expand Up @@ -71,7 +56,7 @@ class ResourceVirtualFileImpl internal constructor(
}

@Throws(IOException::class)
override fun contentsToByteArray(): ByteArray = IOUtils.toByteArray(inputStream)
override fun contentsToByteArray(): ByteArray = inputStream.readBytes()

override fun getTimeStamp(): Long = mFile!!.lastModified()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
/*
* Copyright (C) 2021 Reece H. Dunn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright (C) 2021-2024 Reece H. Dunn. SPDX-License-Identifier: Apache-2.0
package uk.co.reecedunn.intellij.plugin.core.vfs.impl

import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileSystem
import org.apache.commons.compress.utils.IOUtils
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
Expand Down Expand Up @@ -55,7 +40,7 @@ class URLConnectionVirtualFileImpl(
}

@Throws(IOException::class)
override fun contentsToByteArray(): ByteArray = IOUtils.toByteArray(inputStream)
override fun contentsToByteArray(): ByteArray = inputStream.readBytes()

override fun getTimeStamp(): Long = 0

Expand Down

0 comments on commit 220109a

Please sign in to comment.