From be75f795bf2633561272f9d1d70b6ebefee34267 Mon Sep 17 00:00:00 2001 From: Glen Stampoultzis Date: Mon, 30 Jun 2003 12:29:05 +0000 Subject: [PATCH] Hex reader helper stuff. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353181 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/util/HexRead.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/poi/util/HexRead.java b/src/java/org/apache/poi/util/HexRead.java index 734a70622f..bb141b57e5 100644 --- a/src/java/org/apache/poi/util/HexRead.java +++ b/src/java/org/apache/poi/util/HexRead.java @@ -54,10 +54,7 @@ package org.apache.poi.util; -import java.io.IOException; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; +import java.io.*; import java.util.List; import java.util.ArrayList; @@ -207,6 +204,11 @@ public class HexRead return rval; } + static public byte[] readFromString(String data) throws IOException + { + return readData(new ByteArrayInputStream( data.getBytes() ), -1); + } + static private void readToEOL( InputStream stream ) throws IOException { int c = stream.read(); -- 2.39.5