Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 370C3DAAF for ; Wed, 3 Oct 2012 22:40:12 +0000 (UTC) Received: (qmail 56217 invoked by uid 500); 3 Oct 2012 22:40:10 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 56127 invoked by uid 500); 3 Oct 2012 22:40:10 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 56044 invoked by uid 99); 3 Oct 2012 22:40:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 22:40:09 +0000 Date: Thu, 4 Oct 2012 09:40:09 +1100 (NCT) From: "Joerg Schaible (JIRA)" To: issues@commons.apache.org Message-ID: <1650624196.162254.1349304009903.JavaMail.jiratomcat@arcas> In-Reply-To: <1485975364.21702.1336052328921.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (LANG-801) Util for conversion between primitive types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joerg Schaible resolved LANG-801. --------------------------------- Resolution: Fixed Added with minor adjustment to naming conventions. > Util for conversion between primitive types > ------------------------------------------- > > Key: LANG-801 > URL: https://issues.apache.org/jira/browse/LANG-801 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* > Reporter: Sebastien Riou > Assignee: Joerg Schaible > Priority: Minor > Attachments: patch_Conversion.txt > > > A utility class to convert data from one primitive type to another, in the most commonly used fashions (big endian/little endian byte order, lsb first or msb first). > It also deals with arrays of primitive types and String containing hexadecimal numbers. > Such conversions are needed when dealing with embedded software or hardware modeling/design. > I attach a initial version which deals with the "default" encoding, the one which seems the most natural on the JVM: little endian byte ordering, and, within a byte, lsb first. > I plan to implement the other encoding I need: > - big endian, lsb first > - big endian, msb first > So far I implemented about half of the methods needed to cover the default encoding: > - methods to convert a large data type into an array of a smaller data type (longToBytes for example) > - methods to convert an array of a small data type into a larger data type (bytesToLong for example) > The remaining half consist of the methods to convert from an array of a data type into an array of another data type (bytesToLongs, LongsToBytes) > Once this is available for different encodings, the most useful part can be done: the "bridge" methods to convert from one encoding to another -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira