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 204B67E2C for ; Wed, 23 Nov 2011 15:08:04 +0000 (UTC) Received: (qmail 22971 invoked by uid 500); 23 Nov 2011 15:08:03 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 22875 invoked by uid 500); 23 Nov 2011 15:08:03 -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 22866 invoked by uid 99); 23 Nov 2011 15:08:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 15:08:03 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 15:08:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4578099F10 for ; Wed, 23 Nov 2011 15:07:40 +0000 (UTC) Date: Wed, 23 Nov 2011 15:07:40 +0000 (UTC) From: "Joerg Schaible (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <2032944941.6074.1322060860285.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <317279166.2380.1321967681436.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LANG-778) Add UUIDUtils.toByteArray and UUIDUtils.fromByteArray MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155909#comment-13155909 ] Joerg Schaible commented on LANG-778: ------------------------------------- bq: BTW, why did you decide to use high byte first? This is what I said: The UUID is *defined* as sequence of 16 bytes together with a String representation. There's no endian stuff involved. It's just that the UUID Java implementation provides access to the single bits using two long values, which should be a lot faster than an indirection using String. The Java runtime developers did use big endian as natural choice of the JVM default. So, the endian problem does not affect the proposed UUIDUtils, but for something like ByteUtils this might be different. One solution is to document that this class expects big endian and that EndianUtils can be used otherwise. > Add UUIDUtils.toByteArray and UUIDUtils.fromByteArray > ----------------------------------------------------- > > Key: LANG-778 > URL: https://issues.apache.org/jira/browse/LANG-778 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* > Reporter: Joerg Schaible > Assignee: Joerg Schaible > Priority: Minor > Attachments: LANG-778.diff > > Original Estimate: 4h > Remaining Estimate: 4h > > A UUID represents 16 bytes. In some situation (e.g. using DBs that do not have native support for the type UUID) it is necessary to use directly the bytes. The JDK does not support the transformation from UUID to bytes and back, therefore I'd like to add UUIDUtils with the two proposed methods. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira