Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 Google Inc.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   * use this file except in compliance with the License. You may obtain a copy of
   * the License at
   * 
   * http://www.apache.org/licenses/LICENSE-2.0
   * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
  */
 package elemental.html;
 
 import  elemental.html.*;
 
 import java.util.Date;

DRAFT
This page is not complete.

Note: DataView is not yet implemented in Gecko. It is implemented in Chrome 9.

An ArrayBuffer is a useful object for representing an arbitrary chunk of data. In many cases, such data will be read from disk or from the network, and will not follow the alignment restrictions that are imposed on the Typed Array Views described earlier. In addition, the data will often be heterogeneous in nature and have a defined byte order.

The DataView view provides a low-level interface for reading such data from and writing it to an ArrayBuffer.

 
 public interface DataView extends ArrayBufferView {
 
   float getFloat32(int byteOffset);
 
   float getFloat32(int byteOffsetboolean littleEndian);
 
   double getFloat64(int byteOffset);
 
   double getFloat64(int byteOffsetboolean littleEndian);
 
   short getInt16(int byteOffset);
 
   short getInt16(int byteOffsetboolean littleEndian);
 
   int getInt32(int byteOffset);
 
   int getInt32(int byteOffsetboolean littleEndian);


  

Gets a signed 8-bit integer at the specified byte offset from the start of the view.

Parameters
offset
The offset, in byte, from the start of the view where to read the data.
Exceptions thrown
INDEX_SIZE_ERR
The byteOffset is set such as it would read beyond the end of the view
 
   Object getInt8();
 
   int getUint16(int byteOffset);
 
   int getUint16(int byteOffsetboolean littleEndian);
 
   int getUint32(int byteOffset);
 
   int getUint32(int byteOffsetboolean littleEndian);


  

Gets an unsigned 8-bit integer at the specified byte offset from the start of the view.

Parameters
offset
The offset, in byte, from the start of the view where to read the data.
INDEX_SIZE_ERR
The byteOffset is set such as it would read beyond the end of the view
 
   Object getUint8();
 
   void setFloat32(int byteOffsetfloat value);
 
   void setFloat32(int byteOffsetfloat valueboolean littleEndian);
 
   void setFloat64(int byteOffsetdouble value);
 
   void setFloat64(int byteOffsetdouble valueboolean littleEndian);
 
   void setInt16(int byteOffsetshort value);
 
  void setInt16(int byteOffsetshort valueboolean littleEndian);
  void setInt32(int byteOffsetint value);
  void setInt32(int byteOffsetint valueboolean littleEndian);
  void setInt8();
  void setUint16(int byteOffsetint value);
  void setUint16(int byteOffsetint valueboolean littleEndian);
  void setUint32(int byteOffsetint value);
  void setUint32(int byteOffsetint valueboolean littleEndian);
  void setUint8();
New to GrepCode? Check out our FAQ X