[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-14 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=610863&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-610863
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 14/Jun/21 19:21
Start Date: 14/Jun/21 19:21
Worklog Time Spent: 10m 
  Work Description: yurelle commented on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-860932390


   I never thought about using boolean; that's a good idea.  Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 610863)
Time Spent: 1h 50m  (was: 1h 40m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-14 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=610715&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-610715
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 14/Jun/21 14:52
Start Date: 14/Jun/21 14:52
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-860747593






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 610715)
Time Spent: 1h 40m  (was: 1.5h)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-14 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=610710&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-610710
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 14/Jun/21 14:51
Start Date: 14/Jun/21 14:51
Worklog Time Spent: 10m 
  Work Description: XenoAmess commented on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-860747593


   @yurelle 
   ```
   throw new IllegalArgumentException("Input data is longer than size of 
'double' primitive ("+SIZE+" bytes)");
   ```
   tips:
   next time when you wanna bake some codes from a template for all primitive 
types, suggest use `boolean`, as boolean is the less troublesome one in them...
   if cannot use `boolean` then can use `double`
   do never use `int` or `long` as template...that will cause the 
`longer->doubler` thing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 610710)
Time Spent: 1h 20m  (was: 1h 10m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-14 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=610711&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-610711
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 14/Jun/21 14:51
Start Date: 14/Jun/21 14:51
Worklog Time Spent: 10m 
  Work Description: XenoAmess edited a comment on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-860747593


   @yurelle 
   ```
   throw new IllegalArgumentException("Input data is longer than size of 
'double' primitive ("+SIZE+" bytes)");
   ```
   tips:
   next time when you wanna bake some codes from a template for all primitive 
types, suggest use `boolean`, as boolean is the less troublesome one in them...
   if cannot use `boolean` then can use `double`
   do never use `int` or `long` as template...that will cause the 
`longer->doubleer` thing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 610711)
Time Spent: 1.5h  (was: 1h 20m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=609933&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609933
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 10/Jun/21 21:08
Start Date: 10/Jun/21 21:08
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-263091411


   
   [![Coverage 
Status](https://coveralls.io/builds/40492502/badge)](https://coveralls.io/builds/40492502)
   
   Coverage decreased (-0.003%) to 94.936% when pulling 
**bd53cc4decb33872a9712bc9664477bb3de0e8d7 on 
yurelle:LANG-341_AddNumToByteArrayMethods** into 
**d1e9e598c9bcbf91afa174fa9b6c2ef30bbc8157 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609933)
Time Spent: 1h 10m  (was: 1h)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=609932&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609932
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 10/Jun/21 21:02
Start Date: 10/Jun/21 21:02
Worklog Time Spent: 10m 
  Work Description: yurelle commented on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-859064688


   Oh, wait. Maybe not. I thought I saw the build badge saying was building 
successfully. sorry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609932)
Time Spent: 1h  (was: 50m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-06-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=609930&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609930
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 10/Jun/21 21:00
Start Date: 10/Jun/21 21:00
Worklog Time Spent: 10m 
  Work Description: yurelle commented on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-859062564


   It looks like yall fixed the Java 16 build error. Sorry, I couldn't help 
with it. I tried looking into it, but couldn't figure it out.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 609930)
Time Spent: 50m  (was: 40m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-03-29 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=573425&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-573425
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 29/Mar/21 11:23
Start Date: 29/Mar/21 11:23
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-809300879


   We know the build fails on Java 16, there is a separate thread about that
   on the dev ML. It looks like a problem in our data parser or possibly an
   issue in the JDK, hard to say, but we do need help figuring it out.
   
   Gary
   
   On Sun, Mar 28, 2021, 18:16 yurelle ***@***.***> wrote:
   
   > Ok, I fixed the merge conflicts and all the new build style tests that
   > have been added since I first made this PR back in 2016. And the build
   > works for Java 8, but it is dying on the Java 16 build. The errors are
   > complaining about stuff that I didn't touch, so I don't think this is my
   > doing.
   >
   > Also, back when I wrote all this code, I wasn't allowed to use stuff that
   > was added in Java 8 (specifically the BYTES static property that was added
   > to the Primitive object classes). So, I manually created equivalent integer
   > constants in the Conversion class. However, judging by the versions in the
   > automated builds, it appears that java 8 is now the min supported version.
   > If that is the case, then I can update this code to use the Java 8 BYTES
   > fields, and remove the integer constants. Can you confirm if I'm allowed to
   > use stuff that was introduced in Java 8?
   >
   > Also, @dmjones  mentioned a desire to have
   > the PR broken up into chunks to make review easier. I can do that if you
   > want, but I need to know how small you want those chunks to be. My original
   > commit message split the changes into 4 groups of functions:
   >
   >- primitive to byte[] and back
   >- hex to primitive and back
   >- bit strings
   >- invert bit order
   >
   > Would these 4 PR's be sufficient? or do you want it more fine grained?
   >
   > As for the whitespace, Intellij did it automatically; I'm not sure how to
   > undo it.
   >
   > -Yurelle
   >
   > P.S. Sorry for leaving this in limbo for so long, but I've had depression
   > for several years, and with a full-time job, I haven't had the energy to do
   > much else. But I've had some time recently, and I'd like to finally get
   > this finished, if yall still want it.
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > ,
   > or unsubscribe
   > 

   > .
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 573425)
Time Spent: 40m  (was: 0.5h)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   stati

[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-03-28 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=573268&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-573268
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 28/Mar/21 22:16
Start Date: 28/Mar/21 22:16
Worklog Time Spent: 10m 
  Work Description: yurelle commented on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-808968232


   Ok, I fixed the merge conflicts and all the new build style tests that have 
been added since I first made this PR back in 2016. And the build works for 
Java 8, but it is dying on the Java 16 build. The errors are complaining about 
stuff that I didn't touch, so I don't think this is my doing.
   
   Also, back when I wrote all this code, I wasn't allowed to use stuff that 
was added in Java 8 (specifically the BYTES static property that was added to 
the Primitive object classes). So, I manually created equivalent integer 
constants in the Conversion class. However, judging by the versions in the 
automated builds, it appears that java 8 is now the min supported version. If 
that is the case, then I can update this code to use the Java 8 BYTES fields, 
and remove the integer constants. Can you confirm if I'm allowed to use stuff 
that was introduced in Java 8?
   
   Also, @dmjones mentioned a desire to have the PR broken up into chunks to 
make review easier. I can do that if you want, but I need to know how small you 
want those chunks to be. My original commit message split the changes into 4 
groups of functions:
   - primitive to byte[] and back
   - hex to primitive and back
   - bit strings
   - invert bit order
   
   Would these 4 PR's be sufficient? or do you want it more fine grained?
   
   As for the whitespace, Intellij did it automatically; I'm not sure how to 
undo it.
   
   -Yurelle
   
   P.S. Sorry for leaving this in limbo for so long, but I've had depression 
for several years, and with a full-time job, I haven't had the energy to do 
much else. But I've had some time recently, and I'd like to finally get this 
finished, if yall still want it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 573268)
Time Spent: 0.5h  (was: 20m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2021-03-28 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=573264&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-573264
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 28/Mar/21 21:52
Start Date: 28/Mar/21 21:52
Worklog Time Spent: 10m 
  Work Description: coveralls edited a comment on pull request #219:
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-263091411


   
   [![Coverage 
Status](https://coveralls.io/builds/38318037/badge)](https://coveralls.io/builds/38318037)
   
   Coverage decreased (-0.04%) to 94.899% when pulling 
**fee1f6fb628fc8361ae92687bbaa44044aabb986 on 
yurelle:LANG-341_AddNumToByteArrayMethods** into 
**d1e9e598c9bcbf91afa174fa9b6c2ef30bbc8157 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 573264)
Time Spent: 20m  (was: 10m)

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-341) Add number to byte array methods

2020-02-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-341?focusedWorklogId=391113&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-391113
 ]

ASF GitHub Bot logged work on LANG-341:
---

Author: ASF GitHub Bot
Created on: 22/Feb/20 13:52
Start Date: 22/Feb/20 13:52
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #219: LANG-341: Add 
number to byte array methods to org.apache.commons.lang3.Conversion
URL: https://github.com/apache/commons-lang/pull/219#issuecomment-589958248
 
 
   Needs conflicts resolved...
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 391113)
Remaining Estimate: 0h
Time Spent: 10m

> Add number to byte array methods
> 
>
> Key: LANG-341
> URL: https://issues.apache.org/jira/browse/LANG-341
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Lilianne E. Blaze
>Priority: Major
> Fix For: Discussion
>
> Attachments: 341-v1-src.patch, 341-v1-test.patch, LANG-341-2.patch, 
> LANG-341.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hello,
> I need a set of methods to convert Long to or from a byte[] array, as if
> writing / reading from Data(Input/Output)Stream(
> ByteArray(Input/Output)Stream ).
> First, doing it with Streams seems a bit wasteful, second, it seems a
> pretty general use. Would it be possible to add something like that to,
> for example,
> org.apache.commons.lang.math.NumberUtils?
> Example code:
> {code:java}
> static public long toLong(byte[] b)
>   {
> return toLong(b, 0);
>   }
>   
>   static public long toLong(byte[] b, int offset)
>   {
> return (((long)b[offset] << 56) +
> ((long)(b[offset + 1] & 255) << 48) +
> ((long)(b[offset + 2] & 255) << 40) +
> ((long)(b[offset + 3] & 255) << 32) +
> ((long)(b[offset + 4] & 255) << 24) +
> ((b[offset + 5] & 255) << 16) +
> ((b[offset + 6] & 255) <<  8) +
> ((b[offset + 7] & 255) <<  0));
>   }
>   
>   static public byte[] longToByteArray(long l)
>   {
> byte b[] = new byte[8];
> longToByteArray(l, b, 0);
> return b;
>   }
>   
>   static public void longToByteArray(long l, byte b[], int offset)
>   {
> b[offset] = (byte)(l >>> 56);
> b[offset + 1] = (byte)(l >>> 48);
> b[offset + 2] = (byte)(l >>> 40);
> b[offset + 3] = (byte)(l >>> 32);
> b[offset + 4] = (byte)(l >>> 24);
> b[offset + 5] = (byte)(l >>> 16);
> b[offset + 6] = (byte)(l >>>  8);
> b[offset + 7] = (byte)(l >>>  0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)