From 950ce28f720185064af66c9baa889aa811da77c8 Mon Sep 17 00:00:00 2001 From: Christopher Vittal Date: Fri, 8 Mar 2024 11:43:46 -0600 Subject: [PATCH] [query] Remove read/writeUTF from Input/OutputBuffer (#14401) It's dead code. --- hail/src/main/scala/is/hail/io/InputBuffers.scala | 11 ----------- hail/src/main/scala/is/hail/io/OutputBuffers.scala | 6 ------ .../is/hail/utils/richUtils/RichCodeInputBuffer.scala | 3 --- 3 files changed, 20 deletions(-) diff --git a/hail/src/main/scala/is/hail/io/InputBuffers.scala b/hail/src/main/scala/is/hail/io/InputBuffers.scala index 97ad9bfc1d35..d04c032f9d99 100644 --- a/hail/src/main/scala/is/hail/io/InputBuffers.scala +++ b/hail/src/main/scala/is/hail/io/InputBuffers.scala @@ -56,12 +56,6 @@ trait InputBuffer extends Closeable { def readDoubles(to: Array[Double]): Unit = readDoubles(to, 0, to.length) def readBoolean(): Boolean = readByte() != 0 - - def readUTF(): String = { - val n = readInt() - val a = readBytesArray(n) - new String(a, utfCharset) - } } trait InputBlockBuffer extends Spec with Closeable { @@ -354,11 +348,6 @@ final class TracingInputBuffer( override def readBoolean(): Boolean = readByte() != 0 - override def readUTF(): String = { - val s = in.readUTF() - logfile.write(s.getBytes(utfCharset)) - s - } } final class BlockingInputBuffer(blockSize: Int, in: InputBlockBuffer) extends InputBuffer { diff --git a/hail/src/main/scala/is/hail/io/OutputBuffers.scala b/hail/src/main/scala/is/hail/io/OutputBuffers.scala index 74f4e676329e..39bc09338b07 100644 --- a/hail/src/main/scala/is/hail/io/OutputBuffers.scala +++ b/hail/src/main/scala/is/hail/io/OutputBuffers.scala @@ -47,12 +47,6 @@ trait OutputBuffer extends Closeable { def writeBoolean(b: Boolean): Unit = writeByte(b.toByte) - - def writeUTF(s: String): Unit = { - val bytes = s.getBytes(utfCharset) - writeInt(bytes.length) - write(bytes) - } } trait OutputBlockBuffer extends Spec with Closeable { diff --git a/hail/src/main/scala/is/hail/utils/richUtils/RichCodeInputBuffer.scala b/hail/src/main/scala/is/hail/utils/richUtils/RichCodeInputBuffer.scala index 8a4c58c111ec..1fec9f5f73c7 100644 --- a/hail/src/main/scala/is/hail/utils/richUtils/RichCodeInputBuffer.scala +++ b/hail/src/main/scala/is/hail/utils/richUtils/RichCodeInputBuffer.scala @@ -72,9 +72,6 @@ class RichCodeInputBuffer( def readBoolean(): Code[Boolean] = ib.invoke[Boolean]("readBoolean") - def readUTF(): Code[String] = - ib.invoke[String]("readUTF") - def readBytes(toRegion: Value[Region], toOff: Code[Long], n: Int): Code[Unit] = { if (n == 0) Code._empty