Merge "Add FieldPacker contructor that accepts external storage."
diff --git a/api/current.txt b/api/current.txt
index c8f999f..d777707 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -19485,6 +19485,7 @@
public class FieldPacker {
ctor public FieldPacker(int);
+ ctor public FieldPacker(byte[]);
method public void addBoolean(boolean);
method public void addF32(float);
method public void addF32(android.renderscript.Float2);
diff --git a/graphics/java/android/renderscript/FieldPacker.java b/graphics/java/android/renderscript/FieldPacker.java
index a215a57..0a7e882 100644
--- a/graphics/java/android/renderscript/FieldPacker.java
+++ b/graphics/java/android/renderscript/FieldPacker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,12 @@
mData = new byte[len];
}
+ public FieldPacker(byte[] data) {
+ mPos = 0;
+ mLen = data.length;
+ mData = data;
+ }
+
public void align(int v) {
if ((v <= 0) || ((v & (v - 1)) != 0)) {
throw new RSIllegalArgumentException("argument must be a non-negative non-zero power of 2: " + v);