I have some source code that I need to make runnable under Java 5. Unfortunetly that code uses Arrays.copyOfRange function which was only introduced in Java 6. What would be the most effective way to implement same utility using only Java 5 API?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Check out the OpenJDK 6 page - it's open source Java. You can download and read the source code yourself, find out how it's implemented, and add the functionality to the app manually.
Here goes the code from OpenJDK for those who are intrested:
The fastest way would be to use
System.arraycopy
. It's what's done by the Arrays class, BTW.